如何以编程方式更改iPhone X的底边颜色? [英] How to change the bottom edge color on the iPhone X programmatically?

查看:123
本文介绍了如何以编程方式更改iPhone X的底边颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它在原生键盘/表情符号板上会发生变化,这取决于两者中的哪一个是打开的。我认为它会根据 UIInputViewController 自动更改颜色,但是自定义键盘扩展名不会出现这种情况:

It changes on their native keyboard/emoji board, depending which of the two are open. I thought it would change the color automatically based on UIInputViewController, however it is not occurring with custom keyboard extensions:

推荐答案

您可以采取一些措施来解决这个问题。为主页指示符更改 ViewController的View backgroundcolor 。并根据您的需要通过编码分别设置状态栏外观

One thing you can do to solve this. Change backgroundcolor of your ViewController's View for home indicator. And set status bar appearance separately through coding as per your needs.

这将更改您的主页指示符状态栏颜色加上安全区域巧克力色,添加单独视图安全区域为您的其他设计,因为我添加了黄色

This will change your home indicator, status bar color plus a safe area to Chocolate color, Add separate view in safe area for your other design, as I've added yellow.

如果你想要状态栏的颜色不同

If you want different color for your status bar, call it somewhere from viewDidLoad with color you want -

func setStatusBarBackgroundColor(color: UIColor) {

        guard let statusBar = UIApplication.shared.value(forKeyPath: "statusBarWindow.statusBar") as? UIView else { return }
        statusBar.backgroundColor = color
    }  

除此之外,您将无法在外观中进行任何其他更改,至少现在直到苹果提供任何方法来控制外观 主页指标。我来给你展示。

Apart from this, You won't be able to do any other changes in appearance, at least for now till apple provides any way to control appearance of home indicator. let me show you.

这些是酒吧的可用性,你在哪里可以控制它的外观。没有主页指示栏选项Apple已提供更改。

These are the availability of bars, where you can control appearance of it. There is no home indicator bar option Apple has provide for it's alteration.

这些是你可以控制外观的唯一条形码 -

导航栏

搜索栏

状态栏

标签栏

工具栏

These are the only bars you can control appearance -
Navigation Bars
Search Bars
Status Bars
Tab Bars
Tool Bars

推荐链接 - iPhone-X接口指南

这篇关于如何以编程方式更改iPhone X的底边颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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