//提交时转菊花
self.activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(self.view.bounds.size.width/2 - 50, self.view.bounds.size.height/2 - 50, 100, 100)];
self.activityIndicator.layer.cornerRadius = 15;
//菊花下面文字
UILabel *lable = [[UILabel alloc]initWithFrame:CGRectMake(10, 60, 80, 40)];
lable.text = @"正在提交";
lable.font = [UIFont systemFontOfSize:14];
lable.textAlignment = NSTextAlignmentCenter;
lable.textColor = [UIColor whiteColor];
[self.activityIndicator addSubview:lable];
[self.view addSubview:self.activityIndicator];
//菊花样式
self.activityIndicator.backgroundColor = [UIColor colorWithWhite:0.5 alpha:0.5];
self.activityIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
//开启菊花
[self.activityIndicator startAnimating];
[NSTimer scheduledTimerWithTimeInterval:3.0f target:self selector:@selector(timerStop) userInfo:nil repeats:YES];
}
- (void)timerStop
{
//停止菊花
[self.activityIndicator stopAnimating];
//返回上个界面
[self.navigationController popViewControllerAnimated:YES];
}
iOS 小菊花
最新推荐文章于 2018-11-06 09:40:08 发布