Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the bottom edge color on the iPhone X programmatically?

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:

enter image description here

like image 644
VDog Avatar asked Sep 21 '17 22:09

VDog


People also ask

How do I change the background color of a navigation bar in Swift?

navigationController. navigationBar. barTintColor = UIColor. newBlueColor() and of course this just changes the colour of the navigation bar of the view controller that the code is within.

How do I change the background color of a button in Swift?

Method 1 − Using the storyboard editor Add a button on your storyboard, select it Go to it's attribute inspector and select 'Background' property to choose the color.


1 Answers

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.

enter image description hereenter image description here

enter image description here

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     }   

enter image description here

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.

enter image description here

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

Referral Link - iPhone-X Interface Guidelines

like image 195
Kiran Jasvanee Avatar answered Sep 18 '22 10:09

Kiran Jasvanee