4

私のタブバー アプリでは、ナビゲーション コントローラーのタイトル バーのボタンから呼び出されたアクションから UIActionsheet を呼び出します。

UIActionsheet は通常どおりに機能しますが、下の「キャンセル」ボタンの下半分が iPhone シミュレーターで触れても反応しません。キャンセル ボタンの下半分は、UITabBar が背後にある場所であるため、おそらく問題があります。

何か案は?

代替テキスト http://img12.imageshack.us/img12/2166/screenshot20100119at236.png

解決

私の解決策は最初の答えからでした。ここに私の作業例のコードがあります

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:message delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"OK" otherButtonTitles:nil];
        actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
        [actionSheet showInView:[UIApplication sharedApplication].keyWindow];
        [actionSheet release];
4

1 に答える 1

19

これは私にはUIActionSheetのように見えます...

とにかく、アクションシートは、現在のビューではなく、アプリケーションウィンドウのサブビューとして表示する必要があります。

UIActionSheet *actionSheet = [[UIActionSheet alloc] init...];

// ...

[actionSheet showInView:[UIApplication sharedApplication].keyWindow];
于 2010-01-19T20:40:48.730 に答える