Reputation: 221
I am making an iOS App and I wanted to have the status bar show up for a few seconds, display a message, then change bac to the normal status bar. Is there a solution for this in the sdk? Has anyone created anything for this?
Upvotes: 2
Views: 569
Reputation: 2692
An alternative solution is to display a secondary status bar underneath:
iOS: Create a secondary status bar for displaying in-app messages
Upvotes: 0
Reputation: 4918
Here is my shot at the statusbar notification, derived from KGStatusBar but with less code and a simpler API.
Only 5 methods to do the work :
+ (void)showWithStatus:(NSString*)status barColor:(UIColor*)color andRemoveAfterDelay:(NSNumber *) delay;
+ (void)showWithStatus:(NSString*)status andRemoveAfterDelay:(NSNumber *) delay;
+ (void)showWithStatus:(NSString*)status andBarColor:(UIColor*)color;
+ (void)showWithStatus:(NSString*)status;
+ (void)dismiss;
Have a look : http://alexiscreuzot.com/KAStatusBar/
Upvotes: 0
Reputation: 742
I found another one that I have used.
https://github.com/online204/StatusBarNotification
Upvotes: 1
Reputation: 113747
Here's a Github project that will let you display custom text instead of the status bar. It's based on the Mailbox app, which uses the status bar to display mail sync messages. Personally I was surprised that the app review team let Mailbox past with this functionality intact, but they did.
https://github.com/kevingibbon/KGStatusBar
Upvotes: 6
Reputation: 29064
Use uiview animatewithduration. Good tutorial to start: http://www.raywenderlich.com/2454/how-to-use-uiview-animation-tutorial
Example:
[UIView animateWithDuration:0.5 delay:0.2 options:UIViewAnimationCurveEaseInOut animations:^{
[[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleBlackOpaque];
//display ur message
} completion:^(BOOL finished) {
[UIView animateWithDuration:0.5 delay:delay+1.5 options:UIViewAnimationCurveEaseInOut animations:^{
[[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleBlackOpaque];
} completion:^(BOOL finished) {
//remove your message
}];
}];
Hope helps you to start...
Upvotes: 0