How to get rid of safeAreaInsets on UIScrollview (iOS 11, iPhoneX)

后端 未结 2 1480
清歌不尽
清歌不尽 2020-12-19 21:04

I have a horizontal paging UIScrollview, following is my VFL constraints for leading/trailing H:|-0-[ScrollView]-0-| (aligned to superview).

<
2条回答
  •  长情又很酷
    2020-12-19 21:53

    I am using following to skip content inset adjustment:

    UIScrollview.contentInsetAdjustmentBehavior = .never
    

    I found that in iOS 11 UIScrollViewContentInsetAdjustmentBehavior.always includes safe area layout guide and apply these margins as insets, so tried .never it worked ))

提交回复
热议问题