无法将模拟指标设置为更改 [英] can't set simulated metric to change

查看:31
本文介绍了无法将模拟指标设置为更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 UIViewController 与 UITableViewController 分离,它本身嵌入在 UINavigationController 中.

I have a UIViewController segued to from a UITableViewController which is itself embedded in a UINavigationController.

在实用工具检查器的属性窗格中,我已将顶部栏设置为半透明黑色导航栏(在模拟指标下).

In the Attributes pane of the Utilities inspector, I have set Top Bar to Translucent Black Navigation Bar (under Simulated Metrics).

这在 UITableViewController 中一切正常,但我在 UIViewController 中的视图如所描述的那样滑回到导航栏后面here 所以我想我会尝试更改实用工具检查器 > 属性窗格 > 模拟指标 > 顶部栏到黑色导航栏的默认设置.

That works all fine and dandy in the UITableViewController but my view in the UIViewController was sliding back up behind the Navigation Bar as described here so I thought I'd try to change the default for Utilities inspector > Attributes pane > Simulated Metrics > Top Bar to Black Navigation Bar.

没用.我似乎无法推断任何模拟指标.

Didn't work. It seems like I can't UN-infer any of the Simulated Metrics.

推荐答案

只是为了检查你的理解...模拟指标就是状态栏/标签栏等在界面生成器中的显示方式.这些不会影响正在运行的应用程序.

Just to check your understanding... Simulated Metrics are just how the status bar/tab bar etc appear in Interface Builder. These don't affect the running app.

更改状态栏类型最简单的位置是在目标的 info.plist 中:

The easiest place to change your status bar type is in your target's info.plist:

要以编程方式更改它,只需使用:

To change it programmatically, just use:

[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackOpaque;

更改导航栏样式

self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;

这篇关于无法将模拟指标设置为更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆