-(void)postStatusBarNotice:(NSString *)info duration:(NSTimeInterval)time{
statusWin=[[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 320, 20)];
[statusWin setWindowLevel:UIWindowLevelAlert];
msgLabel=[[UILabel alloc]initWithFrame:statusWin.frame];
msgLabel.text=info;
msgLabel.backgroundColor=[UIColor blackColor];
msgLabel.textColor=[UIColor whiteColor];
msgLabel.textAlignment=UITextAlignmentCenter;
msgLabel.font=[UIFont systemFontOfSize:12];
msgLabel.alpha=0.7;
[statusWin addSubview:msgLabel];
[statusWin makeKeyAndVisible];
AppDelegate *appDelegate=(AppDelegate *)[UIApplication sharedApplication].delegate;
[appDelegate.window makeKeyAndVisible];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:time];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(hideCustomStatusBar)];
msgLabel.alpha=1;
[UIView commitAnimations];
}
-(void)hideCustomStatusBar{
[UIView animateWithDuration:.3 animations:^{
msgLabel.transform=CGAffineTransformMakeTranslation(320, 0);
} completion:^(BOOL finished){
[msgLabel release];
CFShow(statusWin);
[statusWin release];
statusWin = nil;
}];