Tag: uiactivityindicatorview

UIActivityIndi​​catorView微调不显示

我试图让我的第一个微调工作,我似乎无法让它显示在屏幕上。 我尝试将故事板上的UIActivityIndi​​catorView拖到我的屏幕上,但是当我试图通过故事板将它连接到我的头文件时,它似乎没有响应。 (那里有什么正确的步骤?) 所以我做了手动。 我将这行添加到我的.h文件中: @property (weak, nonatomic) IBOutlet UIActivityIndicatorView *aSpinner; 然后我将这些行添加到我的.m文件 UIActivityIndicatorView *aSpinner; //throw up spinner from submit btn we created aSpinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle: UIActivityIndicatorViewStyleWhiteLarge]; [self.view addSubview:aSpinner]; [aSpinner startAnimating]; 但是当我进行这个testing的时候,没有一个纺纱工出现。 有什么想法,我在这里做错了吗?

在iTuneslogin提示外观callback

当在iOS应用中处理inApp购买(使用Parse.com)时,用户点击BUY并等待iTuneslogin(或input密码)提示出现。 在等待期间,我显示和activityView要求用户等待。 然后当提示出现时,我需要清理这个activityView。 什么是我需要把代码放入callback函数? 有没有像loginPromptDidAppear? 从中我可以清除activityView。

在后台线程上调用函数ios – 嵌套函数调用会发生什么

在我的主要代码(为了显示UIActivityIndi​​catorView)我在背景线程上调用一个函数,foo()。 foo()调用的函数又会如何呢? 这些函数是否也会在同一个后台线程中调用和执行?

UIActivityIndi​​catorView不显示/开始animation

我有一个UIActivityIndi​​catorView的视图控制器和触发同步的button。 同步在一个单独的类中执行,通常在后台执行。 同步可以从我的应用程序的不同部分触发,我的视图控制器被通知同步事件。 现在,当我点击button时,UIActivityIndi​​catorView不会变得可见或不生动。 这是我在viewDiDLoad中的代码: self.syncNowActivityIndicatorView.hidesWhenStopped = YES; self.syncNowActivityIndicatorView.color = [MRStyleController getFirstLightColor]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(leechStarted) name:MRLeechStartedNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mergeStarted) name:MRMergeStartedNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fileSyncStarted) name:MRFileSyncStartedNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(leechFailed) name:MRLeechFailedNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mergeFailed) name:MRMergeFailedNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fileSyncFailed) name:MRFileSyncFailedNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(leechCompleted) name:MRLeechCompletedNotification object:nil]; [[NSNotificationCenter […]

UIActivityIndi​​catorView正确使用

我的问题涉及在iPhone项目中使用活动指标。 我有一个包含UIActivityIndi​​catorView的类 @interface StatusView : UIView { UIActivityIndicatorView *indicator; UILabel *textLabel; } – (id)initWithFrame:(CGRect)frame Text:(NSString*)text andShowIndicator:(BOOL)value; 在我的业务逻辑代码中,我调用[indicator startAnimating],框架出现在屏幕的底部。 该代码还包含释放指标的dealloc方法 – (void)dealloc { [indicator release]; [super dealloc]; } 大多数情况下,指标运作良好,但有几次不会消失。 我是否总是需要显式调用stopAnimating方法? 释放处理它吗? 什么是正确的用法?

UIActivityIndi​​catorView没有出现iOS 5

我正在尝试实现一个简单的微调,而我的应用程序从互联网上search数据。 我的数据抓取工作正常,但有时需要一段时间,所以我想使用UIActivityIndi​​catorView让用户知道应用程序没有崩溃。 但它目前不工作。 我从这些论坛和其他人那里尽可能地收集到,但由于某种原因,这是行不通的。 再一次,我觉得这个解决scheme可能非常简单。 这是我正在做的事情: 我在.h文件中声明微调为属性: @property (strong, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator; 我还使用故事板将一个微调对象拖到了viewcontroller上,并使用CTRL拖动创build了一个到该属性的连接。 触发URL请求的button(以及随后的数据加载和parsing)实际上触发了一个segue,所以我使用 – (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender function和任何事情都是一样的。 除了prepareforsegue函数之外,我没有附加到button的特定function。 (也许这是一个问题?它是否需要有一个IBAction关联?…) 无论如何,这个函数触发这个: [self GoAheadAndGetData]; 而这又开始如此: – (void)GoAheadAndGetData { [NSThread detachNewThreadSelector:@selector(threadStartAnimating:) toTarget:self withObject:nil]; ……. etc 所以这个函数看起来像这样: – (void) threadStartAnimating:(id)data { [activityIndicator startAnimating]; } 最后,在GoAheadAndGetData函数的最后,我放置了停止animation调用,如下所示: [activityIndicator stopAnimating]; 明白了吗? 请让我知道如果有人需要更多的信息 – 我曾试图剥离到基本,所以我不必在这里发布吨代码… 提前谢谢 – 我真的很感激任何帮助,我可以得到。 我不太清楚为什么现在不行。

如何获得NSOperationQueue完成块

如何获得NSOperationQueue的完成块,这里我想旋转所有操作的开始到结束的活动指示器。 NSOperationQueue *operationQueue = [[NSOperationQueue alloc] init]; // Set the max number of concurrent operations (threads) [operationQueue setMaxConcurrentOperationCount:3]; [operationQueue addOperations:@[operation, operation1, operation3,…] waitUntilFinished:NO]; 谢谢。

隐藏活动指示器

所以在我的主要故事板我创build了一个活动指标。 和我想隐藏我的活动指示器,直到button被按下。 有没有办法可以做到这一点? 这是我的代码,当我按下button的活动指标开始animatig。 self.indicator.hidden = NO; [self.indicator startAnimating]; [self performSelector:@selector(showData) withObject:nil afterDelay:2.0f]; 所以再次的问题,我可以隐藏活动指标,直到button被按下,然后它会显示这个活动指标。

sendAsynchronousRequest使UI冻结

downloadImages是一个button,每当我按下它,一个微调应该开始滚动,一个asynchronous请求应谷歌(以确保有一个连接),并收到响应后,我开始同步下载图像。 不知何故,微调不会去,似乎请求是同步,而不是asynchronous。 – (IBAction)downloadImages:(id)sender { NSString *ping=@"http://www.google.com/"; GlobalVars *globals = [GlobalVars sharedInstance]; [self startSpinner:@"Please Wait."]; NSURL *url = [[NSURL alloc] initWithString:ping]; NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:5.0]; [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) { if (data) { for(int i=globals.farmerList.count-1; i>=0;i–) { //Definitions NSString * documentsDirectoryPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; […]

如何把activityviewicator中的一个tableview

我已经把活动指标 spinner.center = CGPointMake( [UIScreen mainScreen].bounds.size.width/2,[UIScreen mainScreen].bounds.size.height/2); [self.view addSubview:spinner]; 但是这不是在表格视图中正确居中。 因为表格视图可以滚动。 我怎么能把一个微调在屏幕的中心。