ios电池条背景色

2017-09-04  本文已影响18人  只因为趁年轻
设置背景色
设置状态栏颜色
- (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]];

}
上一篇下一篇

猜你喜欢

热点阅读