I am working on an app that is using a few UIViewcontrollers with multiple UIViews. I am trying to setup autolayout but the UIViews are not scaling to the UIViewcontroller size. Can someone point me to a way to resolve this with out the need to redesign the app architecture?
So I have a UIViewController and a subview UIView (addNoteUIView)
When I am adding the subview to the viewController the subview Addnote View not resizing via auto layout to the bounds of the screen and it get cropped.
the subview does not resize to the bounds of the device
How to you fix the second UIView (add note view) to follow the bounds of the device?
EDIT
Thanks Vishal
I am setting the frame on viewdidload
[self.collectionView setFrame:self.view.frame];
[self.collectionView setNeedsLayout];
But, I am getting this behavior from the cells. Why is this happening? multiple bounds? see image with collection view cell error
my code for the collection item size
- (CGSize)collectionView:(UICollectionView *)collectionView
layout:(UICollectionViewLayout*)collectionViewLayout
sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
CGRect screenRect = [_collectionView bounds];
CGFloat screenWidth = screenRect.size.width;
CGFloat screenHeight = screenRect.size.height;
CGFloat cellWidth = (screenWidth / (_lcolumns)); //Replace the divisor with the column count requirement. Make sure to have it in float.
CGFloat cellHeight = (screenHeight / (_lrows));
if(cellWidth < cellHeight)
return CGSizeMake(cellWidth, cellWidth);
else
return CGSizeMake(cellHeight, cellHeight);
}