2010-11-28 20 views
1

私は、自分の電子メールIDとパスワードを入力する必要があるiPhoneアプリケーションを作成しています。その後、自分のWebサイトで自分のアカウントにアクセスできます。バックグラウンドタスクが実行中に何らかの処理を表示するには?

認証情報を入力すると、次のページが表示されるまで数秒待たなければなりません。

「処理中」または「お待ちください」のような記号をユーザーに表示する必要があります。

どうすれば実装できますか?

お願いします。

答えて

0

に役立ちます願っています。

デビッドシンクレアのDSActivityViewクラスはとても簡単です。実装が非常に簡単で、メッセージを表示したり変更したりすることができます。タブバーやナビゲーションバーなど、必要に応じてメッセージを覆うことでUIを無効にすることができます。

http://www.dejal.com/developer/dsactivityview

+0

ありがとうございました。 :) –

1

私は通常、必要に応じてインスタンス化されますのUIViewを作成します。ここでは、あなた自身のアプリで試してくださいするためのいくつかのコードです:

- (id)initWithLabel:(NSString*)labelName { 
    self = [super init]; 
    if (self) { 
     UIImageView *loadingBackgroundView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 150, 120, 40)]; 
     [loadingBackgroundView setBackgroundColor:[UIColor blackColor]]; 
     [loadingBackgroundView setAlpha:0.9]; 
     [loadingBackgroundView.layer setCornerRadius:8.0]; 
     [loadingBackgroundView.layer setBorderColor:[[UIColor clearColor] CGColor]]; 
     [self addSubview:loadingBackgroundView]; 
     [loadingBackgroundView release]; 

     UILabel *loadingLabel = [[UILabel alloc] initWithFrame:CGRectMake (125, 160, 100, 20)]; 
     [loadingLabel setBackgroundColor:[UIColor clearColor]]; 
     [loadingLabel setTextAlignment:UITextAlignmentCenter]; 
     [loadingLabel setTextColor:[UIColor whiteColor]]; 
     [loadingLabel setText:labelName]; 
     [self addSubview:loadingLabel]; 
     [loadingLabel release]; 

     UIActivityIndicatorView *loadingActivityIndicatorView = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(110,160,20,20)]; 
     [loadingActivityIndicatorView setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhiteLarge]; 
     [loadingActivityIndicatorView startAnimating]; 
     [self addSubview:loadingActivityIndicatorView];  
     [loadingActivityIndicatorView release]; 
    } 
    return self; 
} 

これはあなたに以下のようなもの与える:これは多くの人々によって処理されたものですので、あなたならば alt text

0

を他の人の仕事を利用して、ホイールの再発明を避けたい場合は、Tapku Libraryのようなものを使うことができます。オープンソースで、GitHubにあります。

具体的には、TKProgressAlertViewTKLoadingViewクラスをチェックしてください。

関連する問題