Tag: uiactivityindicatorview

如何将活动指标添加到UITableView中的图像?

我创build了自定义tableView并使用其他类中的自定义tableView类来显示tableView .. 我从服务器加载图像,并显示在tableViewRow ..每个image是不同的.. 在屏幕上,只有7个图像会出现,当我向下滚动时,前3个图像重复一段时间,当这些图像加载显示正确的图像..但最初直到新的图像会显示旧图像,我想要放置一个活动指示器来显示图像正在加载而不是旧图像 我想在image的位置添加activity Indicator ,直到image加载.. 我的代码是… self.tableViewX = tableView; static NSString *simpleTableIdentifier = @"SimpleTableCell"; SimpleTableCell *cell = (SimpleTableCell *)[tableView1 dequeueReusableCellWithIdentifier:simpleTableIdentifier]; if (cell == nil) { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"SimpleTableCell" owner:self options:nil]; cell = [nib objectAtIndex:0]; } dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^ { NSString *imageURL = [NSString stringWithFormat: @"www.xyz.image.png"]; cell.thumbnailImageView.image = [UIImage imageWithData:[NSData […]

IOS:UITableView上的ActivityIndi​​cator …如何?

我想显示一个活动指标,而不是在加载数据(在另一个线程)的一个可用的视图。 所以在UITableViewController的ViewDidLoad方法中: -(void)viewDidLoad { [super viewDidLoad]; //I create the activity indicator UIActivityIndicatorView *ac = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; [ac startAnimating]; //Create the queue to download data from internet dispatch_queue_t downloadQueue = dispatch_queue_create("PhotoDownload",NULL); dispatch_async(downloadQueue, ^{ //Download photo ……. ……. dispatch_async(dispatch_get_main_queue(), ^{ …… …… [ac stopAnimating]; }); }); ……. 为什么活动指标不显示在表格视图上? 我怎么能实现它?

显示微调并将其删除在同一个块中

在一个可能需要几秒钟的方法,我有: UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc]initWithFrame:CGRectMake(135,140,50,50)]; spinner.color = [UIColor blueColor]; [spinner startAnimating]; [_mapViewController.view addSubview:spinner]; // lots of code [spinner removeFromSuperview]; 微调不显示。 可能是因为当时屏幕没有更新。 我怎样才能解决这个问题?

在UITableView的底部添加活动指标?

我有UITableview分页像第一个将从服务器获得20个对象,将填充UITableView然后当它到达最后一行需要进行另一个服务调用,以获得下20个对象。我的问题是我需要添加活动指标在我的表底部并应该说“加载”,用户可以滚动到查看当前的对象,但不应该向下滚动。是否有任何自定义控件? 有没有最好的办法来实现它?。提前感谢。

如何在加载UITableViewCell时设置UIActivityIndi​​catorView

我有两个UITableViewController ,A和B.当我点击表格A中的一个单元格时,我将使用UINavigationController来推动表格视图控制器B.但是B的数据是从Internet下载的,这需要几秒钟的时间。 所以我想在加载B时添加一个UIActivityIndicatorView 。我怎么能实现这个?

5秒后closuresUIAlertView

我创build了一个包含UIActivityIndi​​cator的UIAlertView。 一切都很好,但是我也想让UIAlertView在5秒后消失。 5秒后如何closures我的UIAlertView? var alert: UIAlertView = UIAlertView(title: "Loading", message: "Please wait…", delegate: nil, cancelButtonTitle: "Cancel"); var loadingIndicator: UIActivityIndicatorView = UIActivityIndicatorView(frame: CGRectMake(50, 10, 37, 37)) as UIActivityIndicatorView loadingIndicator.center = self.view.center; loadingIndicator.hidesWhenStopped = true loadingIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyle.Gray loadingIndicator.startAnimating(); alert.setValue(loadingIndicator, forKey: "accessoryView") loadingIndicator.startAnimating() alert.show()

如何显示UIActivityIndi​​catorView之前的旋转开始

我想在willAnimateRotationToInterfaceOrientation进行的工作之前显示活动指示器:duration:开始。 大多数情况下,在我的应用程序中,这项工作很快完成,不需要任何活动指示器,但偶尔(第一次轮换,即在caching数据之前,处理大文件时)可能会出现明显的延迟。 而不是重新构build我的应用程序来应付这种罕见的情况下,我宁愿只显示UIActivityIndi​​catorView而应用程序生成caching并更新显示。 问题是(或者似乎是)在willRotateToInterfaceOrientation:duration和willAnimateRotationToInterfaceOrientation:duration:方法之间没有更新显示。 所以要求iOS在willRotate方法中显示UIActivityIndi​​cator视图直到在willAnimateRotation方法之后才会实际影响显示。 以下代码说明了这个问题。 运行时,活动指示器只会非常短暂地出现,并且在完成simulateHardWorkNeededToGetDisplayInShapeBeforeRotation方法之后。 我错过了什么明显的? 如果没有,我怎么能解决这个问题有什么聪明的想法? 更新 :虽然关于种植繁殖到另一个线程等的build议通常是有帮助的,在我的具体情况下,我有一些确实想要阻止主线程来做我的提升。 在应用程序中,我有一个tableView所有的高度需要重新计算。 当 – 这不是一个很常见的用例,或者我甚至不会考虑这种方法 – 有很多行,所有的新高度在[tableView reloadData]中计算(然后caching)。 如果农场的起飞,并让旋转继续,那么在旋转之后,提升之前,我的tableView没有被重新加载。 例如,在横向的情况下,它不占用全部的宽度。 当然,还有其他的解决方法,例如在旋转之前创build一个只有几行的tableView,然后重新加载真正的tableView。 示例代码来说明问题: @implementation ActivityIndicatorViewController @synthesize activityIndicatorView = _pgActivityIndicatorView; @synthesize label = _pgLabel; – (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } – (void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration; { NSLog(@"willRotate"); [self showActivityIndicatorView]; } – (void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration; { NSLog(@"willAnimateRotation"); […]

如何在UIAlertController的中心显示活动指标?

我目前有一个UIAlertController屏幕上显示。 警报的视图应该只在警报的中心显示2个元素,一个标题和一个UIActivityIndicatorView 。 以下是显示警报及其元素的function。 func displaySignUpPendingAlert() -> UIAlertController { //Create the UIAlertController let pending = UIAlertController(title: "Creating New User", message: nil, preferredStyle: .Alert) //Create the activity indicator to display in it. let indicator = UIActivityIndicatorView(frame: CGRectMake(pending.view.frame.width / 2.0, pending.view.frame.height / 2.0, 20.0, 20.0)) indicator.center = CGPointMake(pending.view.frame.width / 2.0, pending.view.frame.height / 2.0) //Add the activity indicator […]

UIActivityIndi​​cator工作不正常?

我有一个关于UIActivityIndi​​cator的问题。 我在IBAction的一个button上应用了[spinner startAnimating] ,然后做了一些处理。 应该停止进程activityindicator,然后导航到另一个视图。 但是活动指示不会出现。 当我删除线“[微调停止animation]”,然后指示器出现,但不是在即时button被按下。 它出现在另一个视图加载之前,显然没有出现,我的意思是没有出现,但如果我们仔细看,那么只有它出现一瞬间。 提前感谢任何答案。

创build一个自定义的UIActivityIndi​​catorView

我想有一个自定义的UIActivityIndicatorView视图,而不是依靠iOS提供的选项。 我怎样才能在这里创build自己的观点? 我有一个图像列表与我创build一个animation视图。