如图,在一个普通的UIView中包含着左右2个scrollView:左侧tableView、右侧collectionView。
显然右侧的collectionView的内边距被影响了,没有在导航栏的下面。
根据经验,首选想到了设置
http://blog.csdn.net/github_26672553/article/details/49925571
http://blog.csdn.net/github_26672553/article/details/49925629
self.automaticallyAdjustsScrollViewInsets = NO;
但在viewDidLoad
方法中设置后也没有作用,后来搜索发现还有个edgesForExtendedLayout
属性。
http://blog.csdn.net/cny901111/article/details/26529949
http://blog.csdn.net/wuyulunbi12580/article/details/52691155
self.edgesForExtendedLayout = UIRectEdgeNone;
有效!!!