Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS status bar: how to show some text there

Tags:

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?

like image 256
Bin Chen Avatar asked Jul 01 '12 06:07

Bin Chen


People also ask

What is the status bar on iPhone?

A status bar appears along the upper edge of the screen and displays information about the device's current state, like the time, cellular carrier, and battery level.

Where is the iOS status bar?

Similar to the Mac's menu bar, iOS has a status bar at the top of the screen that contains symbols with useful information about your iPhone or iPad. With just a quick glance, you can view which settings are enabled on your device, the strength of your cellular connection and more.

How do I change the color of my text bar in swift 5?

Go to Project -> Target , Then set Status Bar Style to Light . It makes status-bar white from the launch screen. Then set View controller-based status bar appearance equal to NO in Info.


2 Answers

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!

like image 58
andycam Avatar answered Oct 04 '22 20:10

andycam


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

like image 34
Stavash Avatar answered Oct 04 '22 21:10

Stavash