views:

43

answers:

2

Hello-

Trying to get up to speed on UIScrollView for an app that I'm working on. Found a tutorial at http://www.tckdeveloper.com/Tutorials/iPhone/ScrollViews.html that helped out and that got the scroll view working in landscape mode. Started adding more content to the view so that scrolling was needed in the portrait view as well. When I run the code the scrolling only works in the landscape orientation. Any ideas why it would scroll in one orientation and not another.

Notes: This is a navigation based app and the view is also making use of UIToolBar.

A: 

Maybe the content size fit in portrait and not in landscape. For example, if you contentSize is set to 700*900, it will fit into the scrollview when in portrait mode and not in landscape mode. The scroll behavior only works when needed.

VdesmedT
A: 

I think you encountered the same problem I did.

http://stackoverflow.com/questions/3422915/scrolling-a-uitableview-inside-a-uiscrollview

Part of the UIScrollView (well, the UITableView, but that is a UIScrollView subclass anyway) was outside the bounds of its parent view. When I adjusted it to always fit inside its parent view (or the visible part of the screen, I'm not sure), the scrolling worked.

Possibly, when in portrait mode, the same thing happens with your UIScrollView. Check your UIScrollView to see if it fits inside the parent view/the visible part of the screen.

Altealice