ios - 在 iOS 上带有指示导航栏的侧边栏菜单

标签 ios objective-c uinavigationcontroller ecslidingviewcontroller

我想创建带有指示 UINavigationBar 的侧边栏菜单,如下图所示。

enter image description here

通过使用 ECSlidingviewController 库,我完成了侧边菜单。但问题是当用户在菜单上滑动时,我需要显示 Navigation Indicator

我该如何创作?有人知道吗?

最佳答案

这里没什么特别的。 只需创建您的 View 并将其添加为 Controller (而非菜单 Controller )中导航栏的 subview 。

这是一个简单的演示:

CGFloat desiredWidth = x;<----replace x.
UIView *testView = [[UIView alloc]initWithFrame:CGRectMake(-desiredWidth,0,desiredWidth,44)];
[testView setBackgroundColor:[UIColor blackColor]];

[self.navigationController.navigationBar addSubview:testView];

关于ios - 在 iOS 上带有指示导航栏的侧边栏菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27721214/

相关文章:

iphone - 使用 Storyboard View Controller 创建编程选项卡栏?

ios - 为什么状态栏没有调整其文本的颜色以匹配我的 UINavigationController?

ios - SWRevealController 不适用于 NavigationController

iphone - 远程 xml 文件和 uinavigationcontroller、nsurlconnection 放置

ios - Alamofire GET 请求无法正常工作

android - 如何模块化地为不同版本的应用程序保留服务器端应用程序

ios - 在 ios 中配置 InAppPurchase 进行沙盒测试

iphone - 适用于 iOS 的狮子风格非模态警报示例

iOS:跟踪付费用户,同时通过应用内购买将付费 iOS 应用程序转换为免费应用程序

ios - 删除注释数组中的重复项