UIScrollView has a different y position when segui

2019-03-03 13:44发布

Not sure how to explain this, simply when seguing from one controller the scroll view is lower on the screen than from another segue where it is correct.

2条回答
再贱就再见
2楼-- · 2019-03-03 13:47

Select your view controller which has lower scroll view and unselect Adjust Scroll View Insets

See below image:

enter image description here


or you can do it programmatically

self.scrollView.contentOffset = CGPointZero;
self.scrollView.contentInset = UIEdgeInsetsZero;
查看更多
趁早两清
3楼-- · 2019-03-03 13:58

Set this 2 scrollview property and check it.

self.scrollView.contentOffset = CGPointZero;
self.scrollView.contentInset = UIEdgeInsetsZero;

Check this answer it may help you UIScrollView adjusts contentOffset when contentSize changes

查看更多
登录 后发表回答