我一直在阅读很多关于iOS7 UI过渡的内容.
我不能够得到什么这三个属性automaticallyAdjustsScrollViewInsets,extendedLayoutIncludesOpaqueBars,edgesForExtendedLayout?
例如,我试图让我的视图控制器从状态栏下面开始,但我无法实现它.
我有一个包含UICollectionView的UIViewController.但是UICollectionView并没有填满所有的UIViewController.
我发现有一些空间的高度等于单元格和UICollectionView顶部边缘之间的NavigationBar的高度.我不知道如何在UICollectionView中将单元格位置设置为(0,0).(像这样,空间是红色矩形)

我找到了这个链接如何设置UICollectionViewCell的位置?我将UICollectionViewFlowLayout子类化(以下是我的代码)
MZMCollectionViewFlowLayout.h
#import <UIKit/UIKit.h>
@interface MZMCollectionViewFlowLayout : UICollectionViewFlowLayout
@end
Run Code Online (Sandbox Code Playgroud)
MZMCollectionViewFlowLayout.m
#import "MZMCollectionViewFlowLayout.h"
@implementation MZMCollectionViewFlowLayout
- (CGSize)collectionViewContentSize
{
return [super collectionViewContentSize];
}
- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect
{
return [super layoutAttributesForElementsInRect:rect];
}
- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"MZMCollectionViewFlowLayout layoutAttributesForItemAtIndexPath");
if (indexPath.section == 0 && indexPath.row == 1) // or whatever specific item you're trying to override
{
UICollectionViewLayoutAttributes *layoutAttributes = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath];
layoutAttributes.frame = CGRectMake(0,0,100,100); // or whatever...
return layoutAttributes;
}
else
{
return [super layoutAttributesForItemAtIndexPath:indexPath];
}
}
@end …Run Code Online (Sandbox Code Playgroud) 我不知道这是怎么发生的,但我的UICollectionViewCell不知何故从顶部向下移动,我无法将其拉回来.此外,界面构建器中的Y位置锁定为64,请参见屏幕截图.

任何帮助都是极好的.比你!