菊花缓冲(UIActivityIndicatorView)

2017-07-03  本文已影响15人  爱喝农药de清凉

初始化:initFrame & initStyle
UIActivityIndicatorView * indicatorView = [[UIActivityIndicatorView alloc]initWithFrame:CGRectMake(0, 0, 8, 8)];
[slider addSubview:indicatorView];

// 设置 风格
indicatorView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
//设置菊花大小
indicatorView.transform = CGAffineTransformMakeScale(0.7, 0.7);
// indicatorView.centerX = slider.centerX;
//设置 完成后隐藏
indicatorView.hidesWhenStopped = NO;
indicatorView.center = slider.center;
//状态栏小菊花
[[UIApplication sharedApplication]setNetworkActivityIndicatorVisible:YES];
indicatorView.backgroundColor = JKRandomColor;

//设置状态栏有个小图标 跟着转动 加载 yes显示 no消失
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];

上一篇下一篇

猜你喜欢

热点阅读