如何使用storyboard(!)设置ScrollView的内容大小?

时间:2014-02-15 19:20:53

标签: objective-c uiscrollview storyboard interface-builder contentsize

enter image description here如何使用stroyboard(!)设置UIScrollView的内容大小?

我有很多滚动视图,所以我不想设置evry one programmaly的大小

1 个答案:

答案 0 :(得分:2)

您可以使用IB设置。

  • 单击要设置内容大小的UIScrollView
  • 转到界面构建器
  • 右侧的实用程序窗格中的身份检查器

在“用户定义的运行时属性

  • 点击+按钮添加新的keyPath
  • keyPath
  • 中的contentSize列类型
  • 对于type列,将其更改为size
  • 对于value列,将其更改为所需的内容大小值。例如:宽度为320,高度为600,请写{ 320, 600 }

修改

以下是Xcode 5中的屏幕截图

http://i41.photobucket.com/albums/e282/RobBob3/ScreenShot2014-02-15at94908PM.png