Iphone UITableView的预加载圆
我搜索了很多论坛,但是没有找到,我的问题是 我需要从web预加载一些数据以加载到UITableView 我看到一些应用解决了这个问题,当显示UITableView时,它们将“等待圈”显示为模式视图,加载数据后,只需隐藏这个圈Iphone UITableView的预加载圆,iphone,objective-c,asynchronous,preloader,Iphone,Objective C,Asynchronous,Preloader,我搜索了很多论坛,但是没有找到,我的问题是 我需要从web预加载一些数据以加载到UITableView 我看到一些应用解决了这个问题,当显示UITableView时,它们将“等待圈”显示为模式视图,加载数据后,只需隐藏这个圈 有没有简单的解决办法 我需要做什么 我需要什么样的请求:synchronius还是asynchronius 如何显示此圆,是否需要显示动画或是否有内部/外部控制 您需要为“等待圈”(活动指示器)创建一个NSThread 1) 线程 2) 活动指示器。那个等待圈叫做活动指示器
您需要为“等待圈”(活动指示器)创建一个NSThread 1) 线程
2) 活动指示器。那个等待圈叫做活动指示器…@Luft:你不能在iPhone中使用gif图像。iPhone不允许gif图像
- (void)showWaitingView {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
CGRect frame = CGRectMake(90, 190, 32, 32);
UIActivityIndicatorView* progressInd = [[UIActivityIndicatorView alloc] initWithFrame:frame];
[progressInd startAnimating];
progressInd.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
frame = CGRectMake(130, 193, 140, 30);
UILabel *waitingLable = [[UILabel alloc] initWithFrame:frame];
waitingLable.text = @"Processing...";
waitingLable.textColor = [UIColor whiteColor];
waitingLable.font = [UIFont systemFontOfSize:20];;
waitingLable.backgroundColor = [UIColor clearColor];
frame = [[UIScreen mainScreen] applicationFrame];
UIView *theView = [[UIView alloc] initWithFrame:frame];
theView.backgroundColor = [UIColor blackColor];
theView.alpha = 0.7;
theView.tag = 999;
[theView addSubview:progressInd];
[theView addSubview:waitingLable];
[progressInd release];
[waitingLable release];
[window addSubview:[theView autorelease]];
[window bringSubviewToFront:theView];
[pool drain];
}
- (void)removeWaitingView {
UIView *v = [window viewWithTag:999];
if(v) [v removeFromSuperview];
}