ios - 如何结合滑动菜单和uitabbarcontroller?

标签 ios objective-c uitabbarcontroller slidingmenu swrevealviewcontroller

我正在尝试集成 UITabBarController带有滑动菜单。我正在使用 SWRevealViewController创建滑动菜单。

以下是我的 Storyboard的图片。

enter image description here

但是 TabView仅对新闻可见。我希望它像 android 一样像一个新 View 。在 android 中,我们可以结合 Navigation Drawer 和 TabPager .
我怎样才能在 iOS 中做到这一点?

最佳答案

尝试如下:

MainTabViewController *frontViewController = [[MainTabViewController alloc] init];
RearViewController *rearViewController = [[RearViewController alloc] init];

UINavigationController *frontNavigationController = [[UINavigationController alloc] initWithRootViewController:frontViewController];
UINavigationController *rearNavigationController = [[UINavigationController alloc] initWithRootViewController:rearViewController];

SWRevealViewController *revealController = [[SWRevealViewController alloc] initWithRearViewController:rearNavigationController frontViewController:frontNavigationController];
revealController.delegate = self;

self.viewController = revealController;
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];           

关于ios - 如何结合滑动菜单和uitabbarcontroller?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36938281/

相关文章:

ios - 如何在 Swift 中使用来自不同 View Controller 的多个核心数据实体

objective-c - 弱属性不使用 ARC 归零

ios - sortedArrayUsingSelector 警告

ios - 使用或不使用全局变量访问 UITabBarController 内的函数/变量?

ios - 动态方法解析

objective-c - 从另一个 modalViewController 解雇ModalViewController

iphone - 横向时如何让 Interface Builder 中的两个 UITextView 正确对齐?

iphone - 如何为iPhone开发图像扫描仪(文本识别器)

ios - UITabBarController 和 UINavigationController 中的编辑按钮

ios - 在 iOS 10 中使用标签栏 Controller 时, Collection View 的高度计算错误