瀏覽代碼

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 年之前
父節點
當前提交
383b77e5df
共有 1 個文件被更改,包括 3 次插入1 次删除
  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];