Sfoglia il codice sorgente

iOS: Fix the forced CollectionView on initial launch

UIDeviceOrientationUnknown wasn't checked therefore UIDeviceOrientationIsPortrait() method
returned false on inital launch causing the CollectionView even when the user was in Portrait.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Soomin Lee 8 anni fa
parent
commit
383b77e5df
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      Sources/VLCLibraryViewController.m

+ 3 - 1
Sources/VLCLibraryViewController.m

@@ -498,7 +498,9 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
 {
     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
         UIDevice *currentDevice = [UIDevice currentDevice];
-        BOOL isPortrait = UIDeviceOrientationIsPortrait(currentDevice.orientation);
+        UIDeviceOrientation orientation = currentDevice.orientation;
+
+        BOOL isPortrait = (orientation == UIDeviceOrientationUnknown) ? self.usingTableViewToShowData : UIDeviceOrientationIsPortrait(orientation);
 
         if (self.isEditing) {
             [self setEditing:NO animated:NO];