views:

27

answers:

1

I want to display a message to the users of my app in the UIStatusBar, but I'd like to maintain the scrollsToTop functionality so a user can tap on the statusbar and scroll a tableView up to the top.

I've looked into adding a UIWindow on top of the current status bar as in this question: http://stackoverflow.com/questions/2666792/add-uiview-above-all-other-views-including-statusbar

But it disables the touches to the status bar.

Note: I've seen several apps that use the statusBar area to display messages such as the "Evernote" app.

Thanks for the help!

A: 

Are you hiding the statusBar ? It's unwise to keep it there but draw into its position, because in different countries, with different mobile operators, the statusBar's elements have a little different positions. I've seen app drawing there over status icons. Ugly!

So I guess you want to add a subview at the position of statusBar. Why don't you intercept touch events in that view and send your tableView a message to scroll to the top ?

Michal
There's 2 reasons I'm resistant to this approach. 1) I don't want to reposition all my views, which will try to readjust their position to the top of the screen after the status bar has been removed. and 2) I'm not sure where to add the subView. My app is basically a drill down tableview app, but I want the info I place in the statusbar area to be visible from all views. How can I add a view that won't be pushed or popped with the other views?
Jonah
If you want to draw something to the area of status bar, you need to place there a view I guess. Remember, even a UILabel is a view. The view which you put there can intercept events and scroll table view appropriately. From app's delegate you should have access to UIWindow (which in fact extends UIView), you can try to add it there.
Michal