- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在尝试将 pkrevealcontroller 滑动菜单集成到现有的 iOS 项目中,该项目具有带有 segues 等的现有 Storyboard。我扩展了 UINavigationViewController 并将我的新类链接到 Storyboard上的 Nav Controller。在我的应用委托(delegate)中,我执行以下操作:
MainNavViewController *frontViewController = [[MainNavViewController alloc] initWithRootViewController:[[myRootViewController alloc] init]];
UIViewController *rightViewController = [[menuViewController alloc] init];
self.revealController = [PKRevealController revealControllerWithFrontViewController:frontViewController
rightViewController:rightViewController
options:nil];
self.window.rootViewController = self.revealController;
当我运行应用程序时,它成功地将滑动菜单图标添加到导航栏,并且前 View 随我想要滑动。但它没有使用我在 Storyboard上添加的标题或 segues。我正在尝试的是什至可能的。
最佳答案
我认为问题在于您正在实例化一个新的 frontViewController —— 这不是您 Storyboard中的那个。我不确定该怎么做,但我会这样尝试。我会在 Storyboard 中添加一个 UIViewController——将其类更改为 PKRevealController,并使其成为 Storyboard 中的初始 Controller ,但不要将其连接到场景的其余部分。在 IB 中为您的 MainNavViewController 提供一个标识符,然后将您的应用委托(delegate)中的代码更改为:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.revealController = (PKRevealController *)self.window.rootViewController;
UIViewController *rightViewController = [[menuViewController alloc] init];
MainNavViewController *frontViewController = [[UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil] instantiateViewControllerWithIdentifier:@"frontViewController"];
[self.revealController setFrontViewController:frontViewController];
[self.revealController setRightViewController:rightViewController];
return YES;
}
关于iphone - 在现有的 Xcode Storyboard上使用 pkrevealcontroller,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14824959/
有谁知道 PKRevealController 是否有一种方法可以在右/左 View 滑入时向隐藏 Controller 添加叠加(暗淡)效果? https://github.com/pkluz/PK
我正在现有项目中实现 PKRevealController。该项目使用 Storyboard,但用户可以在应用程序中玩 Cocos2D 2.0 游戏。 我的问题是,当用户离开 Cocos2D 时,我在
在任何事情之前,我知道另一个用户存在类似的线程,我尝试了其中回答的代码但它对我不起作用,因为我的 VC 和 Storyboard有点不同,因此问同样的问题我的设置和参数 我的 Storyboard和应
我使用 PKRevealController 作为滑动条菜单,在我的前端 Controller 中我有一个带有 canEditRowAtIndexPath 的表格 View ,因为我实现了 PKRev
我有一个带有前 View 和右 View 的 PKRevealController。启用了平移手势,因此我可以通过滑动打开右 View - 太棒了。以另一种方式滑动不会做任何事情,因为它不应该,因为没
我正在尝试使用 PKRevealController,它在前 View Controller 上带有 UIPanGestureRecognizer,因此平移会显示左 View Controller 。
我希望集成 PKRevealController 并为我的应用程序提供整体滑动设置菜单。我找不到任何关于使用 Storyboard进行操作的教程。我已经有一个 Storyboard,其中包含一个导航
我正在尝试将 PKRevealController 添加到我的 Swift 项目,但它不起作用。我认为这是问题所在: 设置 实例化。 PKRevealController *revealControl
我正在尝试将 pkrevealcontroller 滑动菜单集成到现有的 iOS 项目中,该项目具有带有 segues 等的现有 Storyboard。我扩展了 UINavigationViewCon
我正在尝试将 PKRevealController 集成到我现有的项目中。 https://github.com/pkluz/PKRevealController 如果我使用 Storyboard,如
我正在尝试使用滑动侧菜单实现 View ,例如 PKRevealController在 iOS 6.1 中。 A simple demo of this issue with source code
我有一个使用 PKRevealController 的应用程序它实现了一个类似于 iOS 上流行的 Facebook 和 GMAIL 应用程序中的滑出式菜单。该应用程序是在 XCode 5 中构建的,
我正在使用 SWRevealViewController ( https://github.com/John-Lluch/SWRevealViewController ) 来处理两个 Controll
我正在使用 PKRevealController 来显示左侧 Controller 。 PKReveal 连接到我的主视图 Controller ,它是一个导航 Controller 。 我希望当从左
我在一个新的应用程序项目中使用 PKRevealController,你可以在这里找到它:https://github.com/pkluz/PKRevealController 我遇到的问题是正确更改
我是一名优秀的程序员,十分优秀!