Bin Chen
Bin Chen

Reputation: 63369

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?

Upvotes: 21

Views: 15437

Answers (3)

Matt Wielbut
Matt Wielbut

Reputation: 2692

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

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

hidden visible

Upvotes: 3

andycam
andycam

Reputation: 1692

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!

Upvotes: 28

Stavash
Stavash

Reputation: 14314

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 :)

Upvotes: 3

Related Questions