I am new to objective-C programming.
I am using UIScrollView with some labels, image and text view on it.
I have turned off Autolayout and already tried wit
After user interface orientation going to landscape, my UIScrollView shown its UIScrollIndicator being misplaced. To fix this, you need to add the following code.
As per iOS 13, yet supporting iOS 12 and earlier:
// Fixes the scroll indicator misplacement when rotated in landscape
if #available(iOS 13.0, *) {
v.automaticallyAdjustsScrollIndicatorInsets = false
} else {
// Fallback on earlier versions
v.contentInsetAdjustmentBehavior = .never
}
v.contentInset = .zero
v.scrollIndicatorInsets = .zero
Swift 3.0
self.automaticallyAdjustsScrollViewInsets = false
scrollView.contentInset = UIEdgeInsets.zero
scrollView.scrollIndicatorInsets = UIEdgeInsets.zero;
Just select your view controller and set shown option to false (uncheck)
iOS 11
In my case only changing this UIScrollView Content Insets property in IB from Automatic
to Never
helped.
Swift 3.0
self.automaticallyAdjustsScrollViewInsets = false
scrollView.contentInset = UIEdgeInsets.zero
scrollView.scrollIndicatorInsets = UIEdgeInsets.zero;
scrollView.contentOffset = CGPoint(x: 0.0, y: 0.0);
Swift 3 (Auto Layout)