I have a View Controller that creates its view programatically through the loadView
method. The purpose of the view is to display a data models contents. When the v
I think the problem is due to incorrect automatic set of content insets of the scrollview.
Try the following. In your loadView
, set self.automaticallyAdjustsScrollViewInsets
to NO
(only if NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1
). Now, set the contentInset
and scrollIndicatorInsets
to the correct values depending on OS version:
scrollview.contentInset = scrollview.scrollIndicatorInsets = UIEdgeInsetMake(NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_6_1 ? 0 : 64, 0, 0, 0);