Write some text in (or on) UIStatusBar

I know, it's a strange question ^^,

I would like to know if there is a way to write some text in (or on) the UIStatusBar. In particular I want to write some text on the Status Bar when the user press a UIButton.

Thanks!

Answers


I'm not sure if you can draw directly into the status bar, but you should be able to draw on top of it in a custom view. You can get the status bar's frame using:

CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];

And you can get the application's main window (presumably the status bar's superview) using:

UIWindow *mainWindow = [[UIApplication sharedApplication] keyWindow];

You should be able to add your custom view directly to the key window in the status bar's frame. For an example of an app that appears to "modify" the status bar, take a look at Reeder.


Need Your Help

What does the GDB backtrace message “0x0000000000000000 in ?? ()” mean?

c++ gdb pthreads fastcgi freebsd

What does it mean when it gives a backtrace with the following output?

Guaranteed FIFO using JPA (Hibernate implementation) with MySQL

java mysql hibernate jpa

I need to persist a queue of tasks in MySQL. When reading them from DB I have to make sure the order is exactly the same as they have been persisted.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.