ios电池条背景色

ios电池条背景色_第1张图片
设置背景色
设置状态栏颜色
- (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]];

}

你可能感兴趣的:(ios电池条背景色)