ios - SWRevealViewController 导航栏右键项目

标签 ios iphone swift swift2 swrevealviewcontroller

我正在使用 SWRevealViewController 库在我的应用中用作左滑菜单;

github 链接:SWRevealViewController

我已经下载了以下项目示例 Appcoda project example 并且我已将菜单 Controller 嵌入到导航 Controller 中,因此我可以将项目添加到栏按钮,但我看不到我添加的右侧栏按钮项目(+ 符号作为 ADD 的示例)

我尝试更改菜单 Controller 的宽度,但一切都出错了,您知道缩短侧边菜单宽度以便我可以看到添加的右侧栏按钮项目的方法吗?

在下图中,+ sigh 位于左(主) Controller 下方。

我是新手:)

提前致谢

Example

最佳答案

执行类似下面的代码并根据您在 cgrectmake

中的位置设置 x 值
 UIButton *PlusBtn = [[UIButton alloc] initWithFrame:CGRectMake(0,0,44,44)];
    PlusBtn.tag = 654;
    [PlusBtn setImageEdgeInsets:UIEdgeInsetsMake(14, 14, 16, 16)];
    [PlusBtn setImage:[UIImage imageNamed:@"menu_icon1.png"] forState:UIControlStateNormal];
    [PlusBtn addTarget:self action:@selector(ShowLeft) forControlEvents:UIControlEventTouchUpInside];
    PlusBtn.enabled = NO;

    [self.navigationController.navigationBar addSubview:PlusBtn];

关于ios - SWRevealViewController 导航栏右键项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34366560/

相关文章:

ios - 使用 Parse 创建封闭的用户组

ios - 你如何设置 UILayoutPriority?

ios - 如何从 CLGeocoder 返回值?

ios - 如何在 ios 中的应用程序中播放 RTSP url

iphone - 如何垂直对齐 UITextView 中的文本?

ios - 如何为 View Controller 中的单个按钮创建两个 segue?

ios - 在 App Store 中将一个应用程序替换为另一个应用程序

ios - __strong 非 ARC 项目中使用的限定符

iphone - 迪尔德 : Symbol not found: error how to resolve this issue

ios - 滚动 ViewController Swift