When I don’t have any objects on the scrollview in interface builder it scrolls just fine but as soon as I start adding buttons or labels to the view, it will only scroll down about 50 additional pxs. Anyone know why this is happening or how to fix it? Here’s the code for my scroll. Im using xcode 4.5.2
@interface ViewController : UIViewController{
IBOutlet UIScrollView *scrollview;
}
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[scrollview setScrollEnabled:YES];
[scrollview setContentSize:CGSizeMake(320, 1200)];
}
Try moving your code to viewDidAppear: instead of viewDidLoad:. View did load gets called when the view is loaded into memory, but may not be in the view hierarchy yet.
This should work better: