2013-05-25 63 views
2

我正在制作iOS应用程序,我希望状态栏显示几秒钟,显示一条消息,然后将bac更改为正常状态栏。在sdk中是否有解决方案?有没有人为此创建任何内容?更改iOS状态栏

回答

6

这里有一个Github的项目,将让你显示自定义文本,而不是状态栏。它基于邮箱应用程序,该应用程序使用状态栏显示邮件同步消息。就我个人而言,我感到惊讶的是,应用程序审查团队让邮箱过去这个功能完好无损,但他们做到了。

https://github.com/kevingibbon/KGStatusBar

enter image description here

+0

评论应该不是问题。应用程序不需要显示状态栏。 – Sulthan

+0

感谢您的回答! – user2420649

0

使用uiview animatewithduration。很好的教程开始:http://www.raywenderlich.com/2454/how-to-use-uiview-animation-tutorial

例子:

[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 
     }]; 
    }]; 

希望可以帮助您开始...

+0

谢谢!为了答案! – user2420649

0

这里是我的投篮在状态栏通知,从KGStatusBar但用更少的代码和一个简单的API的。

只有5种方法做的工作:

+ (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; 

看一看:http://alexiscreuzot.com/KAStatusBar/