UIActivityIndicatorView
2016-05-03 15:03
567 查看
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. [self showWaitingView]; } - (IBAction)buttonClick:(id)sender { [self removeWaitingView]; } - (void)showWaitingView { CGRect frame = CGRectMake(90, 190, 32, 32); UIActivityIndicatorView* progressInd = [[UIActivityIndicatorView alloc] initWithFrame:frame]; [progressInd startAnimating]; progressInd.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge; frame = CGRectMake(130, 193, 140, 30); UILabel *waitingLable = [[UILabel alloc] initWithFrame:frame]; waitingLable.text = @"Processing..."; waitingLable.textColor = [UIColor whiteColor]; waitingLable.font = [UIFont systemFontOfSize:20]; waitingLable.backgroundColor = [UIColor clearColor]; frame = [UIScreen mainScreen].bounds; UIView *theView = [[UIView alloc] initWithFrame:frame]; theView.userInteractionEnabled = NO; theView.backgroundColor = [UIColor blackColor]; theView.alpha = 0.7; theView.tag = 999; [theView addSubview:progressInd]; [theView addSubview:waitingLable]; [self.view addSubview:theView]; [self.view bringSubviewToFront:theView]; } - (void)removeWaitingView { UIView *v = [self.view viewWithTag:999]; if(v) [v removeFromSuperview]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end
相关文章推荐
- 2016.05.03,英语,《Vocabulary Builder》Unit 21
- IOS开发中如何给UIImageView添加点击事件
- android color values
- Dataquest用户流失预测
- Android——requestWindowFeature()的应用
- UIPageViewController
- 使用map的value值排序
- 设置searchDisplayController的searchResultsTableView的UITableViewStyle为grouped
- JSP for query
- [leetcode] 307. Range Sum Query - Mutable 解题报告
- Request.InputStream 接收Post Data
- UILabel加下划线
- 347. Top K Frequent Elements
- APUE------高级I/O
- 如何重置VCSA6.0 ROOT用户密码。
- 使用Autolayout实现UITableView的Cell动态布局和高度动态改变
- Java 与 QtQuick 之 WebSocket
- HDOJ3785 priority_queue AC, set TLE ,vector TLE
- MySQL java.sql.SQLException: Incorrect string value: '\xF0\x9F\xA4\x97' for column
- Maximum Subarray