设置状态栏颜色
- (void)setStatusBarBackgroundColor:(UIColor*)color {
UIView*statusBar = [[[UIApplicationsharedApplication]valueForKey:@"statusBarWindow"]valueForKey:@"statusBar"];
if([statusBarrespondsToSelector:@selector(setBackgroundColor:)]) {
statusBar.backgroundColor= color;
}
}
背景色渐变
- (void)scrollViewDidScroll:(UIScrollView*)scrollView{
CGPointoffset = scrollView.contentOffset;
[selfsetStatusBarBackgroundColor:[UIColorcolorWithRed:0.24fgreen:0.53fblue:0.97falpha:offset.y/200.f]];
}
网友评论