Making a UIScrollView in IB

Discussion in 'iOS Programming' started by wrjohns, Jun 3, 2009.

  1. wrjohns macrumors newbie

    Joined:
    May 4, 2009
    #1
    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.
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    For whatever reason there's no way to set the contentSize in IB. Set it in your viewDidLoad method.
     

Share This Page