1、设置系统的状态栏为透明的
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent];
2、增加状态栏级别的UIWindow
CGRect frame = CGRectMake(0, 0, 320, 20);
UIWindow *statusWindow = [[UIWindow alloc] initWithFrame:frame];
[statusWindow setBackgroundColor:[UIColor clearColor]];
[statusWindow setWindowLevel:UIWindowLevelStatusBar];
UIView *view = [[UIView alloc] initWithFrame:frame];
[view setBackgroundColor:[UIColor greenColor]];
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(200, 0, 50, 20)];
[label setBackgroundColor:[UIColor clearColor]];
label.text = @"TEST";
label.textColor = [UIColor redColor];
[view addSubview:label];
[statusWindow addSubview:view];
[statusWindow makeKeyAndVisible];
效果图:
当然你也可以在这个UIWindow上做一些动画处理