Why is UIScrollView leaving space on top and does not scroll to the bottom

后端 未结 13 2758
眼角桃花
眼角桃花 2020-12-01 09:15

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

13条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 10:05

    On iPhoneX this will also occur due to some non-sense safe area stuff that auto-layout tried to account for. Fix (for iPhoneX) with this:

    if (@available(iOS 11.0, *)) {
        scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    }
    

提交回复
热议问题