ios - 带有 LargeTitles 的自定义 UINavigationBar 在 IB 中不起作用
问题描述
所以我用 .xib 文件创建了 MyViewController 类。我拖放了一个 NavBar 并将其放置在安全区域的范围内。
MyViewController 在其他地方实例化并放在 UINavigationController 中。
let myVC = MyViewController(nibName: "MyViewController", bundle: nil)
let nav = UINavigationController(rootViewController: myVC)
self.present(nav, animated: true, completion: nil)
在我设置的 MyViewController 里面
self.navigationController?.setNavigationBarHidden(true, animated: false)
所以 UINavigationController 的默认导航栏没有显示,我只看到我的自定义导航栏,我可以手动编程他的行为和东西。
现在.. 在 IB 中,我勾选了Prefers Large Titles框,但任何地方似乎都没有改变。有任何想法吗 ?
不,我不想将我的 VC xib 放入 UINavigationController,我想将其保留为 UIViewController,以便以编程方式在其他地方随意使用它,并分别拥有自己的 UINavigationBar。
解决方案
推荐阅读
- azure-active-directory - 从 Azure AD 获取 SAML 属性中的电子邮件和经理 ID
- python - 无法在python中安装任何包
- oracle - Oracle 12c 程序
- php - 如何在 Laravel 中使用 sendmail?
- jquery - 使用 jQuery 在图像类中附加 src
- npm - “尝试安装 webpack 时找不到模块‘webpack/schemas/WebpackOptions.json’”
- python - SQLite 和 Python - 从数据库中获取值
- sql - 获取列,4 个表
- angularjs - 没有从控制器获取 $rootScope.updatedata 到 html 视图
- graph - amCharts 4 (v4) 在饼图中设置特定颜色