Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
551 views
in Technique[技术] by (71.8m points)

ios7 - UICollectionView adds top margin

I want to put a UICollectionView control that shows thumbs horizontally (only a single line of thumbs). For some reason the UICollectionView push the thumbs 44 pixels down, so the "0" height is actually "44". I assume it might be adding this space to consider the navigation bar height (I just assume). Since my UICollectionView is only on part of the screen, I don't want this margin. Is there a way to remove it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The issue may be in collection view's content insets. Try to add self.automaticallyAdjustsScrollViewInsets = NO; into view controller's viewDidLoad method.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...