0

私はを呼び出してUIViewController、ナビゲーションベースのプロジェクトで次のように提示しています。

[self presentModalViewController:self.controller animated:YES];

コントローラの上部にはUIToolBar、IBで作成した2つのボタンがあります。すべてが表示されますが、私の上部に見えないものがありますUIToolBar。ボタンの1つをクリックしても何も起こらないので、私は結論を下しました。一番上(時刻のあるバー)をクリックすると、ボタンがアクティブになります。クリックしても何も起こらない領域は、ナビゲーションバーと同じです。その場合、ツールバーのボタンにアクセスできるように、ナビゲーションバーの上にビューを配置するにはどうすればよいですか?

4

2 に答える 2

1

今、私はそれが正しく機能しています!のサブクラスである自分のコントローラーではなく、でpresentModalViewController呼び出す必要があります。それが誰かを助ける場合に備えて、ここにいくつかのコードがあります:UINavigationControllerUIViewController

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:self.contr];
[self presentModalViewController:navController animated:YES];
[navController release];

そして、viewDidLoadで、コントローラー内で:

UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(goBack:)];
self.navigationItem.leftBarButtonItem = cancelButton;
于 2011-06-12T18:37:56.213 に答える
0

単純:

yourView.userInteractionEnabled = NO;
于 2011-06-10T16:19:12.860 に答える