简体   繁体   中英

Home indicator background color on iPhone X?

I use landscape orientation in my app. And I want to change home indicator background in iPhone X to transparent. How to do it?

Instead of changing the color of the home indicator, you could use some of the new UIViewControllers APIs to hide the home indicator.

In your view controller, you can override prefersHomeIndicatorAutoHidden to always return true .

var prefersHomeIndicatorAutoHidden: Bool { return true }

However, Apple does not guarantee that the home indicator will be hidden in all cases.

Check out Apple's " Designing for the iPhone X " and other 2017 fall videos for more information on how to deal the home indicator.

In the " Designing for the iPhone X " video, Apple also talk about "edge protection". So if your app has custom gestures, you may want to look into preferredScreenEdgesDeferringSystemGestures .

In general, Apple does not advise messing around with the home indicator.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM