开发者

iPhone: How can I turn a flipside view into a scrolling UIScroll view?

Thi开发者_运维百科s should be simple. I'm making a very basic app, based on the Utility Application template of XCode. On the flipside, I have more content than fits the screen. The flipside is a UIView. I think it should be a UIScrollView, but somehow I don't get it to work. Can anybody here advise me on this?


With a UIScrollView it is not enough just to place the control into Interface Builder and place the items within it; you have to set its content size in code.

Therefore in the -viewWillAppear method (or similar) you should have something like:

[scrollView setContentSize:CGSizeMake(320, 600];

This would make the content size inside the scroll view 600 pixels high (ie larger than the height of your iPhone display). If everything else is wired up correctly, this shoud now work.

Note: You may also then need to reposition your objects within the view. Set frame.origin for the objects that require this...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜