Become a MacRumors Supporter for $25/year with no ads, private forums, and more!
  • Did you order new AirTags? We've opened a dedicated AirTags forum.

straber

macrumors member
Original poster
Jul 3, 2012
60
0
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,
 
Last edited:

dejo

Moderator emeritus
Sep 2, 2004
15,981
450
The Centennial State
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?
 
Comment

straber

macrumors member
Original poster
Jul 3, 2012
60
0
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?

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.
 
Comment

straber

macrumors member
Original poster
Jul 3, 2012
60
0
Can you elaborate on this? Same frame as what?

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.
 
Comment

straber

macrumors member
Original poster
Jul 3, 2012
60
0
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.
 
Comment

Duncan C

macrumors 6502a
Jan 21, 2008
853
0
Northern Virginia
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.

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.
 
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.