我正在研究JASidePanel stackController。
但我想知道是否有可能永久保持屏幕左侧的菜单,与JASidePanel无关。
为了做到这一点,我试图将JASidePanelController作为其他UIViewController的子视图插入,如下所示:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// My part ---------------------
UIViewController *rootViewController = [ [ UIViewController alloc ] init ];
UIView *rootView = [ [ UIView alloc] initWithFrame:CGRectZero ];
rootView.autoresizingMask = UIViewAutoresizingFlexibleWidth + UIViewAutoresizingFlexibleHeight;
[rootView setBackgroundColor:[UIColor yellowColor]];
rootViewController.view = rootView;
// ---------------------
JASidePanelController *sidePanelController =[[JASidePanelController alloc] init];
sidePanelController.leftFixedWidth = 260;
self.viewController = sidePanelController;
self.viewController.shouldDelegateAutorotateToVisiblePanel = NO;
self.viewController.leftPanel = [[JALeftViewController alloc] init];
self.viewController.centerPanel = [[UINavigationController alloc] initWithRootViewController:[[JACenterViewController alloc] init]];
self.viewController.rightPanel = [[JARightViewController alloc] init];
self.viewController.view.frame = CGRectMake(61, 0, self.viewController.view.frame.size.width, self.viewController.view.frame.size.height );
[ rootView addSubview:self.viewController.view ];
// My part ---------------------
self.window.rootViewController = rootViewController;
// ---------------------
[self.window makeKeyAndVisible];
return YES;
}
它有效,但我并不完全满意。
实际上,当我向左滑动手指时,为了显示右侧面板,中央面板不能正确向左移动并覆盖我的个人菜单(黄色)。
因此,右侧面板完全不可见,我的菜单(黄色)不可见。
请看看我的插图,了解我想做什么。
有人知道该怎么做吗?
非常感谢您的预付款!