1

私はiPhoneアプリを作成しています。このアプリでは、ユーザーがメールIDとパスワードを入力する必要があります。そうすれば、ユーザーは私のWebサイトで自分のアカウントにアクセスできます。

認証の詳細を入力したら、次のページが表示されるまで数秒待つ必要があります。

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

どのように実装すればよいですか?

お願い助けて。

4

4 に答える 4

2

あなたが探しているのは活動指標です。

これがアクティビティインジケーターのチュートリアルです。

http://www.edumobile.org/iphone/iphone-programming-tutorials/use-activityindicator-in-iphone/

お役に立てば幸いです

于 2010-11-28T09:19:29.173 に答える
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;
}

これにより、次のようなものが得られます。 代替テキスト

于 2010-11-28T09:48:28.743 に答える
0

ParthBhattが指摘したように、それはあなたが望む活動指標です。

私はDavidSinclairのDSActivityViewクラスがとても好きです。実装が非常に簡単で、メッセージの表示と変更が簡単です。必要に応じて、タブバーやナビゲーションバーを含めてUIをカバーすることでUIを無効にすることができます。

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

于 2010-11-28T09:43:53.733 に答える
0

これは多くの人が扱ってきたものなので、他の人の仕事を利用して車輪の再発明を避けたい場合は、TapkuLibraryのようなものを使用できます。オープンソースであり、GitHubにあります。

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

于 2010-11-28T19:58:57.600 に答える