rag*_*oat 0 objective-c uiactivityindicatorview ios
我有一个带有UIActivityIndicatorView的TableViewController作为子视图,而内容加载并且它的工作方式应该如此.唯一的问题是我无法将活动指示器置于屏幕中心.
CGFloat width = CGRectGetWidth(self.view.bounds);
CGFloat height = CGRectGetHeight(self.view.bounds);
loadingIndicator = [[UIActivityIndicatorView alloc]initWithFrame:CGRectMake(width / 2, height / 2, 125, 125)];
loadingIndicator.center = CGPointMake(width / 2, height / 2);
loadingIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
loadingIndicator.hidesWhenStopped = YES;
[self.tableView addSubview:loadingIndicator];
[loadingIndicator startAnimating];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
821 次 |
| 最近记录: |