0

たくさんのフォーラムを検索しましたが、何も見つかりませんでした。私の問題は

UITableViewにロードするには、Webからいくつかのデータをプリロードする必要があります。

一部のアプリでこの問題が解決されたことがわかりました。UITableViewを表示すると、モーダルビューとして「待機中の円」が表示され、データが読み込まれた後、この円を非表示にします。

  1. これを行うための簡単な解決策はありますか?
  2. 私は何をする必要がありますか?
  3. どのような種類のリクエストが必要ですか:synchroniusまたはasynchronius?
  4. この円を表示する方法、animatedGifを表示する必要がありますか、それともこれに対する内部/外部コントロールがありますか?
4

2 に答える 2

0

「待機サークル」のNSThreadを作成する必要があります-(アクティビティインジケーター)。

1)スレッドメインスレッドではないNSThreadを作成するにはどうすればよいですか

2)アクティビティインジケーターアクティビティインジケータービューの使用方法

于 2012-05-14T08:46:17.093 に答える
0
 - (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];

}
于 2012-05-14T09:09:58.163 に答える