美文网首页
UIScrollerView的contentInset属性

UIScrollerView的contentInset属性

作者: 男人宫 | 来源:发表于2020-04-11 10:20 被阅读0次
  • 该属性为内边距属性,默认为UIEdgeInsetsZero.当我们需要在uiscrollerview子类(如tableview)的视图之上增加视图时,就可以用到
self.tableView.contentInset = UIEdgeInsets(top: 200, left: 0, bottom: 0, right: 0)
//设置scrollview滑动条的位置;
//当你设置了contentInset,为了保证滑动条跟scrollview内容保持一致
self.tableView.scrollIndicatorInsets = self.tableView.contentInset;

相关文章

网友评论

      本文标题:UIScrollerView的contentInset属性

      本文链接:https://www.haomeiwen.com/subject/ypwemhtx.html