I've got a UINavigationController with a UIViewController showing a navigation bar.
I've specifically set [self setAutomaticallyAdjustsScrollViewInsets:YES];, though this should be YES by default anyway.
I add a UIScrollView:
self.scrollView = [[UIScrollView alloc] initWithFrame:self.view.bounds];
[self.view addSubview:self.scrollView];
However, the UIScrollView's contentInset is {0, 0, 0, 0}, so I am wondering why it doesn't inherit the content inset from the view controller as the documentation states it would.
If I add subviews to the scroll view and set their Y to be self.scrollView.contentInset.top they don't appear below the navigation bar, which is what I am expected.
What am I doing wrong here? It works fine if you start out with a UITableViewController since it correctly inherits the contentInset from the view controller.
Thanks!
viewDidAppearor later? - Jason MooreloadView- runmadloadViewthan creating and assigning something toself.view. - Jason Moore[setAutomaticallyAdjustsScrollViewInsets:]will not work i.e. View -->Other views (UIButton, UILabel, UIView etc) -->ScrollView - JLau_cy