ios - 如何让Master VC出现在UISplitViewController的右边?

标签 ios swift

我想编写一个具有主从布局的应用程序。

但我希望 Master VC 使用 UISplitViewController 出现在右侧。

有什么办法可以让Master VC从右边出现?

最佳答案

SWRevealViewController 提供功能。 安装它的最简单方法是将以下内容复制到您的项目中:

SWRevealViewController.h SWRevealViewController.m 在您的项目中:

初始化传入“后”和“前” View Controller 的 SWRevealViewController 实例。 可选地添加一个“右” View Controller 或传递 nil 作为“后” View Controller 。 在代码中使用 SWRevealViewController 实例,就像使用任何 View Controller 一样。 部署为应用程序窗口 rootViewController,或作为其他包含 Controller 的子级。 获取SWRevealViewController提供的panGestureRecognized和tapGestureRecognizer。您可以将它们保留为默认行为,也可以将它们添加到“前” View Controller 上的合适 View 中。例如,将 panGestureRecognizer 添加到前端 Controller 的 viewDidLoad 方法上的导航栏。 无论是否启用动画,您都可以随时以编程方式或基于用户操作显示、隐藏“后”或“右” View 或替换任何 View Controller

检查以下链接:

https://github.com/John-Lluch/SWRevealViewController

关于ios - 如何让Master VC出现在UISplitViewController的右边?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37158810/

相关文章:

swift - 在 iOS 中滚动时禁用 uitableview 禁用重用

ios - 无法为事件保存 PFUser

ios - 意外发现 nil URL SWIFT

ios - 如何按给定大小的 block 从字符串拆分为数组

objective-c - iOS:UIPickerView 默认尺寸

ios - 如何避免 Fetching Core data Entity as Fault?

ios - NSURLConnection 在 instruments 中增长,这是 NSURLCache 吗?

ios - 在 iOS Swift 中更改导航栏项目的 alpha 值

swift - 在 CoreLocation 中使用新的 CLVisit

ios - Xcode : This coder requires that replaced objects be returned from initWithCoder: