Browse Source

fix collection view cell sizes
fix collection view size in slide over mode

Tobias Conradi 9 years ago
parent
commit
3e5c8c5ca5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Sources/VLCLibraryViewController.m

+ 2 - 2
Sources/VLCLibraryViewController.m

@@ -103,7 +103,7 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
 
 - (void)setupContentViewWithContentInset:(BOOL)setInset
 {
-    CGRect viewDimensions = [UIScreen mainScreen].bounds;
+    CGRect viewDimensions = [UIApplication sharedApplication].keyWindow.bounds;
     UIView *contentView = [[UIView alloc] initWithFrame:viewDimensions];
     contentView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
     contentView.backgroundColor = [UIColor VLCDarkBackgroundColor];
@@ -785,7 +785,7 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
 - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
 {
     const CGFloat maxCellWidth = 300.0;
-    const CGFloat aspectRatio = 9/16;
+    const CGFloat aspectRatio = 9.0/16.0;
 
     CGRect windowFrame = [UIApplication sharedApplication].keyWindow.frame;
     CGFloat windowWidth = windowFrame.size.width;