Resolved scroll view doesn't scroll in certain area

Discussion in 'iOS Programming' started by straber, Mar 9, 2013.

  1. straber, Mar 9, 2013
    Last edited: Mar 17, 2013

    straber macrumors member

    Joined:
    Jul 3, 2012
    #1
    I have a view controller that has 2 nested scroll views, one that pages side to side and one that scrolls the content vertically. Everything was working fine, but now I'm updating the app to fit the iPhone 5 screen, and now there's an area about 60 pixels high at the bottom of the screen where if I touch there, the view won't scroll vertically, but I can touch there and page side to side. I've checked, and the frame of both scroll views are exactly the same, but the vertical one won't respond to drags. This area of the screen works fine for scrolling in both directions on an iPhone 4 screen.

    Any ideas why this might be?

    Thanks,
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Are you saying that your sub scrollView is resizing correctly on the iPhone 5 to take up the extra room but that no vertical touches are being detected in that additional space?
     
  3. straber thread starter macrumors member

    Joined:
    Jul 3, 2012
    #3
    Exactly, I've verified through debugging that both scroll views have the same frame, but the vertical scroll view doesn't respond to touches below where an iPhone 4 screen would end and I have no idea why.
     
  4. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    Can you elaborate on this? Same frame as what?
     
  5. straber thread starter macrumors member

    Joined:
    Jul 3, 2012
    #5
    I mean that when I detect an iPhone 5 screen, I change the frame of both scroll views, the one that scrolls vertically, and the one the scrolls horizontally. I verified that both scroll views have their frame changed to be the same height and location, yet the horizontal scroll view works fine, but the vertical scroller doesn't respond to touches near the bottom of the screen.
     
  6. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
  7. straber thread starter macrumors member

    Joined:
    Jul 3, 2012
    #7
    I assume the UIWindow size must be correct since all other controls respond to touch events at all locations on the screen.
     
  8. straber thread starter macrumors member

    Joined:
    Jul 3, 2012
    #8
    Finally figured this out. I was correctly re-sizing the scroll view size for an iPhone 5 screen, but I neglected to re-size the view that the scroll view was a subview of.
     
  9. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #9
    You should really be using auto-resizing and let the system take care of this for you.

    IF you're using struts and springs, set the content view of your view controller to pin on all 4 sides and resize in both dimensions. Then set up the struts and springs on the child views so they pin to the appropriate part of the screen and the "important" view resizes to use the maximum available size.

    I haven't used autolayout much yet aside from testing with it, but the idea is the same.
     

Share This Page