automaticallyAdjustsScrollViewInsets not working

后端 未结 5 1606
终归单人心
终归单人心 2020-11-29 01:25

I\'ve created an extremely simple demo app to test the functionality of automaticallyAdjustsScrollViewInsets, but the last cell of the tableView is covered by m

5条回答
  •  悲&欢浪女
    2020-11-29 01:43

    I just solved this issue with iOS 11 and swift 4, my current problem was that iOS11 has a new property to validate the insets when a ScrollView does exist, that one is contentInsetAdjustmentBehavior which is a ScrollView's property and the default property is automatic so my code was:

    if #available(iOS 11, *) {
        myScroll.contentInsetAdjustmentBehavior = .never
    } else {
        self.automaticallyAdjustsScrollViewInsets = false
    }
    

    I hope this solve your problems too...

提交回复
热议问题