Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

wrjohns

macrumors newbie
Original poster
May 4, 2009
9
0
Every example I've seen with UIScrollViews is done programmatic. I'd like to know how to do this through IB.

I plopped a UIScrollView onto my view. I plopped a view as a child inside the scrollview. When I compile it, all is good except the content view doesn't scroll. Doing a bit of reading/searching I see that the scrollview needs to be made aware of the size of the content view before it can scroll. Fair enough. But why cant IB just examine the size of my content view? I can't seem to find anyway from within IB to set the content view size.

Incidentally, in the inspector for the UIScrollView, there's 8 values you can set that I can't figure out... content inset, and scroller insets for top/bottom/left/right. I tried playing with these some, but I can't detect any changes.
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
For whatever reason there's no way to set the contentSize in IB. Set it in your viewDidLoad method.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.