I've got a UIScrollView
in IB linked to the delegate and with the proper referencing outlet, declared in my header:
IBOutlet UIScrollView *scrollView;
And called in my viewDidLoad
:
- (void)viewDidLoad
{
[super viewDidLoad];
[scrollView setScrollEnabled:YES];
[scrollView setContentSize:CGSizeMake(320, 500)];
}
It has the correct size and width in IB, and the default values in the Attributes inspector.
Why can't I scroll it?
EDIT: Also, layer wise there is no other view conflicting for a z-index.
Is the content size larger than the scrollview's frame? That's the only way it'll scroll.
Double-check that you have content size bigger than scroll view size itself. If it will be bigger it will scroll.
m using Xcode 6/iOS 8+ now with auto-layout turned on, and I had the same problem in the first place, removing auto-layout doesn't work at all, so in order to make scroll view scrollable vertically, I made sure the following:
If you want to make the scroll view scrollable horizontally, then make sure its content size width is bigger than the screen width, the other rule applies the same.
This worked for me, hope it can help someone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With