如何显示加载的表视图的 UIActivityIndicatorView
一个相当短的问题,如何在视图加载后 0.5 秒内加载 UIActivityIndicatorView?
我环顾四周,但大多数教程都使用 webview,其中创建 if 语句,其中 (webview.loading) 用于定义动画的长度等。 所以我只是想知道如何在视图加载 0.5 秒时执行此操作。
目前,我有一种方法可以将先前选择的单元格居中,我希望指示器能够持续到完成为止。
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self performSelector:@selector(scrollToRowAtIndexPath) withObject:nil afterDelay:1.0];
}
- (void)scrollToRowAtIndexPath
{
[self.tableView reloadData];
[self.tableView scrollToRowAtIndexPath:oldCheckedIndexPath atScrollPosition:UITableViewScrollPositionMiddle animated:NO];
}
A fairly short question, How can I load a UIActivityIndicatorView for say 0.5 seconds from when the view loads?
I have had a look around but most tutorials are using the webview where an if statment is created where (webview.loading) is used to define the length of the animation etc..
so i am just woundering how to do this when ever the view loads for .5 second.
Currently I have a method that centers the previously selected cell which I would like the indicator to last untill this is done.
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self performSelector:@selector(scrollToRowAtIndexPath) withObject:nil afterDelay:1.0];
}
- (void)scrollToRowAtIndexPath
{
[self.tableView reloadData];
[self.tableView scrollToRowAtIndexPath:oldCheckedIndexPath atScrollPosition:UITableViewScrollPositionMiddle animated:NO];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许有些这样的帮助:
Maybe some like that helps: