Browse Source

library: trust the status bar more the device when checking the current rotation

Felix Paul Kühne 11 years ago
parent
commit
d9757af271
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Sources/VLCPlaylistViewController.m

+ 2 - 1
Sources/VLCPlaylistViewController.m

@@ -122,6 +122,7 @@
 - (void)viewWillAppear:(BOOL)animated
 - (void)viewWillAppear:(BOOL)animated
 {
 {
     [super viewWillAppear:animated];
     [super viewWillAppear:animated];
+    [self.collectionView.collectionViewLayout invalidateLayout];
     [self _displayEmptyLibraryViewIfNeeded];
     [self _displayEmptyLibraryViewIfNeeded];
 }
 }
 
 
@@ -429,7 +430,7 @@
 - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
 - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
 {
 {
     if (SYSTEM_RUNS_IOS7_OR_LATER) {
     if (SYSTEM_RUNS_IOS7_OR_LATER) {
-        if (UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation))
+        if (UIDeviceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation))
             return CGSizeMake(341., 190.);
             return CGSizeMake(341., 190.);
         else
         else
             return CGSizeMake(384., 216.);
             return CGSizeMake(384., 216.);