Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个非常简单的问题,不知何故我还没有在这个网站上找到答案。我有一个背景为黄色的视图。我在视图中显示内容,为了使状态栏不与内容冲突,我希望背景不透明,最好设置为特定颜色。
我如何使用情节提要做到这一点?
我看到的唯一方法是添加一个与视图顶部对齐的 20 高度视图作为状态栏背景。
20 是状态栏的当前大小,但如果您以编程方式获得它会更好。
[UIApplication sharedApplication].statusBarFrame.size.height