ios - 浮动面板。面板内导航
问题描述
我是 IOS 的新手,正在为我的项目使用FloatingPanel。我花了很多时间来了解如何在 FloatingPanel 中创建导航
我的代码
主视图控制器
var fp: FloatingPanelController?
fp = FloatingPanelController()
fp?.delegate = self
fp?.contentInsetAdjustmentBehavior = .never
// get first child view controller
if let child1ViewController = coordinator?.getChild1ViewController() {
fp?.set(contentViewController: child1ViewController)
self.present(fp!, animated: true, completion:nil )
}
Child1ViewController
class Child1ViewController: UIViewController{
// some code
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func next(_ sender: Any) {
// error here, self.navigationController is nil
coordinator?.showChild2ViewController(navigationController: self.navigationController!)
}
}
协调员
func showChild2ViewController(navigationController: UINavigationController) {
let viewСontroller = Child2ViewController.instantiate(storyboardName: stroryboardName)
navigationController.pushViewController(viewСontroller, animated: true)
}
解决方案
推荐阅读
- angular - 如何仅从角度 4 中的订阅中获取最新值
- java - 捆绑多个 java 应用程序
- apache-nifi - 颠簸变换以删除破折号加上更复杂的东西
- java - Sudo 命令适用于 unix,但不适用于 java 代码
- php - 是否需要在我的网站中有 ssl 才能集成社交媒体登录
- c++ - C++ - 是否将 const 幻数放入命名空间
- javascript - 反应本机导航并导航到另一个屏幕问题
- sql-server - 使用 LINKED SERVER 从 SQL 插入到 ORACLE
- security - 通过脚本 Appmaker 限制对页面的访问
- html - 用 svg 替换字体真棒图标