i have a view like iphone's springboard . i created it using a scroll view and buttons.i want to disable horizontal scrooling on that view.i want only vertical scrolling.how do i do this?
+7
A:
You have to set the contentSize property of the UIScrollView. For example, if your UIScrollView is 320 pixels wide (the width of the screen), then you could do this:
CGSize scrollableSize = CGSizeMake(320, myScrollableHeight);
[myScrollView setContentSize:scrollableSize];
The UIScrollView will then only scroll vertically, because it can already display everything horizontally.
Dave DeLong
2009-06-30 16:31:27
thank you your method works fine
Rahul Vyas
2009-07-01 06:23:02
A:
if you used interface builder you can select the scrollView and in the inspector there is an option to disable horizontal scrolling.
zPesk
2009-06-30 16:33:51