I am using storyboard with auto layout, scene contains UITextView with some text in it, you can see in following image:
But whenever i move to this scene in running application, it would be like following:
I have researched it a lot and tried following code, even then it not worked for me:
[self.scrollView setContentOffset:CGPointZero animated:NO];
Any help would be appreciated.
Try following, may it help:
[yourTextView scrollRectToVisible:CGRectMake(0,0,1,1) animated:YES];
OR
set the content offset in viewDidLayoutSubviews
for it to take effect.
- (void)viewDidLayoutSubviews {
[yourTextView setContentOffset:CGPointZero animated:NO];
}
OR
in viewDidLoad
[yourTextView scrollRangeToVisible:NSMakeRange(0, 1)];