Appropriate way to scroll an app that is larger than the iPad screen?

Discussion in 'iOS Programming' started by chrono1081, May 12, 2014.

  1. chrono1081 macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #1
    Hi guys,

    I have a form consisting of labels and boxes and it is larger than the iPad screen. All I need to be able to do is design the form and have it scroll vertically (just like scrolling down a webpage).

    My first assumption was to use a UI Scroll View but I'm starting to think that is the wrong way to go about it. I can't get it to work for the life of me. Am I using the right thing?

    I've tried a few configurations but my thoughts were to have this:

    View Controller
    ->UIScrollView
    --->View
    ------>Buttons, labels, etc


    It's been awhile since I've done iOS dev so I know the issue is on my end but can someone clarify if I am on the right path? Thank you.
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Yes, a UIScrollView seems like the correct approach.

    Care to elaborate? What difficulties are you encountering?
     
  3. chrono1081 thread starter macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #3

    Thanks! I just wanted to make sure I was on the right track. I'm getting my feet wet again with iOS.

    As for the problems I think it's just something in Interface Builder. I can't seem to make my buttons move below the UI View. I haven't had a chance to look at the docs yet though to see why that may be.
     
  4. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    Are you saying you're trying to add elements to your scroll view such that its content size is larger than its displayed size?
     
  5. chrono1081 thread starter macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #5
    Yes.

    The iPad app is only allowed to be landscape, but the form is much longer than landscape allows (not my design choice) so I need to be able to build the form larger than the landscape mode allows.
     
  6. JohnsonK macrumors regular

    Joined:
    Mar 6, 2014
    #6
    Drag and dropping a UIScrollView would not be enough. You have to set its contentSize as well, so it knows it is supposed to allow scroll(vertical or horizontal)
     
  7. chrono1081 thread starter macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #7
    Thanks guys!
     

Share This Page