开发者

Integrate an UIScrollView to an existing view

I have a View in a xib file and a corresponding ViewController. With Interface Builder I put an image, some labels and now a table view in it.

What I want to have, is that the whole view will be scrollable, because the new table view is currently only scrolling insid开发者_开发技巧e the tableview boundaries.

How can I put a scroll view behind this existing view with IB?

I already put a UIScrollView to the IB and put all other elements on it. Also I create an UIScrollView IBOutlet and connect it, but the screen is not scrollable...

Do I have to do something like

[myScrollView addSubview: ???];

Thank you a lot in advance & Best Regards.


You need to set the contentSize property of the scrollview before it is usable. Yeah, I know - freaking ridiculous that this isn't automatic.

Just do myScrollView.contentSize = CGSizeMake(int, int).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜