Fork me on GitHub

在collection view中加入 NavigationController问题

在开发过程中用collectionView集合视图的时候,用navgationController跳转会出现导航栏掩盖部分内容现象,

这时候需要在viewDidLoad里面填写

self.edgesForExtendedLayout = UIRectEdgeNone;

 

然后会发现下面也不能全部显示,总是需要往上拖一下才显示出来,但是一松手又会被遮住

这个时候需要设计整个collectionView的大小了

self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height-64)]

 

然后再运行会发现上下都正好合适

posted @ 2015-11-14 11:28  平凡的不平凡  阅读(151)  评论(0编辑  收藏  举报
AmazingCounters.com