简体   繁体   中英

How to add a bar on top of the iphone screen (below status bar)?

Can someone advise me on how I can implement a "touch to return to call" type of UI as seen in the screenshot below?

在此处输入图像描述

My intention is to display the bar on top when my application receives a notification.

Any guide or resources on this will be greatly appreciated

There is several ways how you can place something below your status bar.
1. You can add UIView to UIWindow and position it to be under status bar. Set status bar style to black translucent, so the underneath view will be visible. Resize rootViewController appropriately, so it won't overlap your view.
2. Also, you can set wantsFullScreenLayout property of your rootViewController to true , so it'll cover the entire screen and manage view hierarchy inside it. You also need to set status bar style to black translucent.

Alternatively, you can add views above status bar, but I don't think that this is a good user experience. Here is how you can do that: Add UIView Above All Other Views, Including StatusBar

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