0
votes

I've got a StoryBoard (Viewcontroller) which has been set to freeform and has the size of 320 x 600.

I then added a UIScrollView to this with the size 320 x 600. I placed all of my buttons, textfields etc on top of this.

in my viewDidLoad, i added the following code.

//scroller settings//
[scroller setScrollEnabled:YES];
[scroller setContentSize:CGSizeMake(320, 600)];

I connected up the UIScrollView on the storyboard with scroller.

When i actually run my simulator, the scroller doesn't actually start from the top of the view, it starts a bit lower for some reason.

I made sure the actual scroller is positioned right at the top. Auto layout is off.

Any ideas why this is happening? It's driving me crazy.

Thanks

1
is the scrollview scrolled down or misplaced entirely? its hard to tell from your question. ill rephrase that: is it a problem with the scrollviews behaviour or with its frame? - katzenhut
I'm not sure I understand the question, but one reason may be the status bar of the device. Have you removed the statusbar? Should it be removed or not? - Nikola Kirev

1 Answers

0
votes

Try scrolling to the top:

[scroller setContentOffset:CGPointZero animated:YES];