I have a UICollectionView that displays a vertical list of cells. It's basically a tableview but I'm using the collection view for more controller of how each cell is placed in the view. For some reason, the last cell in the collection view is clipped. I can drag up to see the bottom half, but as soon as I let go the collection view bounces back into place, obscuring the bottom half of the last cell. I have a xib that contains the collectionview, and then I register collection view cells from another xib. This whole view is placed in a navigation controller programmatically. My thoughts are that it has to be an issue with autolayout. Since I'm adding the view controller containing the collection view to a navigation controller programmatically, no constraints are set between the collection view and the navigation bar. If I hide the instantiated navigation bar and just drag one out in IB, the collection view cell is not clipped. But I don't want to do it this way. I've tried programmatically adding constraints, but that doesn't work either. Does anyone have any suggestions? Here's how I'm creating the navigation controller and placing the view controller containing the collection view into it. Also, the code I've tried to use to add constraints is include. For the time being, I'm doing this in the app delegate in didFinishLaunchingWithOptions:
self.homeViewController = [[FFHomeViewController alloc] init];
FFNavigationPanelViewController *navigationController = [[FFNavigationPanelViewController alloc] init];
UINavigationController *frontNavigationController = [[UINavigationController alloc] initWithRootViewController:self.homeViewController];
// frontNavigationController.navigationBarHidden = YES;
UINavigationController *rearNavigationController = [[UINavigationController alloc] initWithRootViewController:navigationController];
NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:self.homeViewController.collectionView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.homeViewController.navigationController.navigationBar attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0.0];
[self.viewController.frontViewController.view addConstraint:topConstraint];