瀏覽代碼

iOS: Fix menu showing when changing orientation

Fix by resetting the state of the menu by implementing the delegation of RESideMenu.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Soomin Lee 8 年之前
父節點
當前提交
1647be2fa2
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. 10 1
      Sources/VLCSidebarController.m

+ 10 - 1
Sources/VLCSidebarController.m

@@ -16,7 +16,7 @@
 #import "RESideMenu.h"
 #import "UIDevice+VLC.h"
 
-@interface VLCSidebarController()
+@interface VLCSidebarController() <RESideMenuDelegate>
 {
     RESideMenu *_sideMenuViewController;
     VLCMenuTableViewController *_menuViewController;
@@ -58,6 +58,8 @@
     }
     _sideMenuViewController.backgroundImage = [UIImage imageNamed:@"menu-background"];
 
+    _sideMenuViewController.delegate = self;
+
     if ([[UIDevice currentDevice] VLCSpeedCategory] <= 2) {
         _sideMenuViewController.animationDuration = 0.1f;
         _sideMenuViewController.parallaxEnabled = NO;
@@ -133,4 +135,11 @@
     }
 }
 
+#pragma mark - RESideMenu Delegate
+
+- (void)sideMenu:(RESideMenu *)sideMenu willHideMenuViewController:(UIViewController *)menuViewController
+{
+    _menuVisible = NO;
+}
+
 @end