gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 22:29:48 25 4
gpt4 key购买 nike

我正在尝试集成 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com