2

I am setting contentInsetUse to add to the scrolling area around the content like following

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.collectionView.contentInset    =   UIEdgeInsetsMake(30.0f, 0.0f, 70.0f, 0.0f);

    UINib *cellNib = [UINib nibWithNibName:@"NibCell" bundle:nil];
    [self.collectionView registerNib:cellNib forCellWithReuseIdentifier:@"reusedCell"];

    // Set layout for UIViewCollection
    CollectionViewLayout *flowLayout        =   [[CollectionViewLayout alloc] init];
    [self.collectionView setCollectionViewLayout:flowLayout];

}

At the first time the app is installed on either an simulator a device, the contentInset is not working

enter image description here

You can see the top is not set at all but the bottom. However when I kill the app by double click on Home button or hitting run from xcode again.contentInset is set. enter image description here

So frustrating now..... What I am missing here. Please help if you have experienced it. Thanks

4

0 に答える 0