PDA

View Full Version : Setting UIViewController to be non-scrollable




RossOliver
Apr 12, 2008, 10:41 AM
Hey,

There doesn't seem to be a property to disable a UIView from being scrollable... does anyone know how?

I have a UIViewController that has a nav bar, table view and toolbar at the bottom and I want it all to be fixed so the user can't scroll...

Thanks,

-Ross



Sbrocket
Apr 12, 2008, 11:24 AM
myTableView.scrollEnabled = NO;


http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIScrollView_Class/Reference/UIScrollView.html#//apple_ref/occ/cl/UIScrollView

P.S. This is because the UIScrollView subclass, UITableView, is making it so that you can scroll...its not something really specific to your view controller or the view. I'm not exactly sure how the chain works, but setting the UITableView's scroll to be off will stop it.

RossOliver
Apr 12, 2008, 11:43 AM
myTableView.scrollEnabled = NO;

http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIScrollView_Class/Reference/UIScrollView.html#//apple_ref/occ/cl/UIScrollView


Perfect - I never thought to check its superclasses :o

Cheers