0

SplitView があり、ユーザーが MasterView の特定のセルに触れると、データを DetailView にロードするために ModalView を全画面表示する必要があります。この ModalView は巨大な TableView であるため、ユーザーへのフィードバックとして Spinner を追加する必要があります。MasterView の didSelectRow でメソッドを呼び出して MBProgressHUD を追加しましたが、すぐには表示されません。アプリが巨大なテーブルをロードし、HUD が表示されますが、その瞬間は役に立ちません。では、表示される前にテーブルのロードを待つ必要があるのはなぜですか?

これは擬似コードでの私のロジックです:

MasterViewControllerで

 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    if(indexPath.section==0 && indexPath.row==5) {
        HUD = [MBProgressHUD showHUDAddedTo:((AppDelegate*)[[UIApplication sharedApplication] delegate]).window.rootViewController.view animated:YES];
        HUD.labelText = @"Loading";
        HUD.labelFont = [UIFont systemFontOfSize:18];
        HUD.delegate = self;
        [self performSegueWithIdentifier:@"MyModalView" sender:self];
    }

     }

MyModalViewで

- (void)viewDidLoad {
    // load all stuff related to table data
    [self removeHUD];
}

私の質問は、セグエの実行中に別の部分的なソリューションを追加した HUDの表示と非常によく似てい ますが、その提案を使用して、アプリを横向きで使用すると奇妙な回転が発生し、縦向きでも機能しません。

4

1 に答える 1

-1

あなたの見解ではロードされました

 HUD=[[MBProgressHUD alloc] initWithView:self.view];
HUD.labelText=@"Wait...";
[self.view HUD];
[HUD setDelegate:self];

[HUD show:YES] を使用します。[HUD hide:YES]; 必要に応じて

于 2013-08-31T10:55:32.437 に答える