进出口使用显示与警报查看活动指标:警报查看活动指示灯显示时间
UIAlertView *Alert= [[UIAlertView alloc] initWithTitle:@"Loading"
message:@"\n"
delegate:self
cancelButtonTitle:nil
otherButtonTitles:nil];
UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
spinner.center = CGPointMake(139.5, 75.5);
[Alert addSubview:spinner];
[spinner startAnimating];
[Alert show];
[Alert dismissWithClickedButtonIndex:0 animated:YES];
的唯一的事情是它消失关闭屏幕真正的快,我想指定警报亮起的时间屏幕显示两秒钟,而不是现在显示的纳秒。我不确定如何去实现这一点,我会使用某种NSTimer,如果有的话,一些建议如何实现这一点将非常感激。谢谢。
通常情况下,如果要显示微调那是因为你正在做的工作,为什么不把它驳回只要工作就完成了?或者你真的希望它被定时?如果你想要它是2秒,那么你会使用'NSTimer'。我不明白为什么你会觉得显示警告视图,并立即解雇,将有超过一毫秒显示不同的结果... – 2012-07-12 18:59:00
当我行动使用Twitter的框架孤单的应用鸣叫似乎是约两倍的延迟从按钮按下到显示的twitter表单三秒钟。 Alert View(警报视图)显示大约5秒钟,并留出2.5秒的暂停时间。我试过'timer = [NSTimer scheduledTimerWithTimeInterval:(1.2/2.0)target:self selector:@selector(loading)userInfo:nil repeatats:YES]; '我只是得到异常,所以试图围绕 – JSA986 2012-07-12 19:23:05
工作似乎仍然直觉把它作为一个计时器例外。您不应该假设在延迟期间应让警报视图显示的延迟。这是它的主要目的。收到信息后,您应该可以将解雇信息放在一个地方。 – 2012-07-12 19:31:34