how do I use UIScrollView in Interface Builder?

后端 未结 17 1429
遇见更好的自我
遇见更好的自我 2020-11-28 19:52

While I\'ve used UIScrollView successfully in the past by manipulating it programmatically, I\'m having trouble getting it to work by setting it up exclusively

17条回答
  •  无人及你
    2020-11-28 20:18

    If you click on the Properties icon of any View Controller in Interface Builder, you can set it to a "Freeform" size in Simulated Metrics and change the size of the main View to be your desired content size.

    This way you can create your ScrollView's content as if it were one large view. As it's only a simulated metric your View Controller will be resized to the window's bounds when it's loaded.

提交回复
热议问题