简体   繁体   中英

iOS status bar: how to show some text there

In top-most bar of iPhone screen, I don't know it's called status bar or not. I want to write some text on that after I finish some actions, is there any API for that or example?

You should find the gitHub project MTStatusBarOverlay very useful. Drop-in class that allows easy yet powerful creation of custom status bar overlays. Some other classes that achieve the same thing can also be found here.

Those saying this goes against good iOS design, I think that if used sparingly and only where appropriate, it can help de-clutter apps that have a lot of information already displayed on-screen.

EDIT: A good and current example of this is largely hyped email app Mailbox . It uses status bar overlays to indicate progress of running tasks, freeing up the whole screen to display content!

The status bar is meant for the operation system's use only - this means that it can show the time, network activity indicator, battery status and such but it is not customizable. I imagine that this is not exactly the case if you're talking about development for a jailbroken environment though.

An interesting option for you might be creating a custom status bar .

UPDATE

Since I wrote this answer, I've come across several projects on Cocoa Controls that might help:

KGStatusBar

FDStatusBarNotifierView

TWStatus

Seems as though this has become "sexy" since the MailBox app :)

An alternative solution is to display a secondary status bar underneath:

iOS: Create a secondary status bar for displaying in-app messages

隐可见

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