6

私はUIActionSheetこのようなものを示しています:

-(void)accessoryPressed:(id)sender{
    //Omitted unnecessary objects

    UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:titleString delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Delete" otherButtonTitles:@"Upload", nil];
    //actionSheet.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
    actionSheet.actionSheetStyle = UIActionSheetStyleBlackTranslucent;
    actionSheet.tag = ((UIButton*)sender).tag;
    [actionSheet showFromRect:[(UIButton*)sender frame] inView:[(UIButton*)sender superview] animated:YES];
}

senderオブジェクトがのアクセサリ ビューUIButtonに埋め込まれている場所。UITableViewCell

問題は、iPad を回転させたときにアクションシートのサイズが変更されないことです (実際にサイズ変更することは期待していませんが、正しい X、Y にする必要があります) AutoResizingMask を FlexibleLeft と FlexibleTop に設定しようとしましたが、そうではありません変わるようです。

actionSheet がaccessoryView自動回転後に指すようにする方法について誰か考えがありますか?

これは次のようになります。

回転前- 回転前

回転後 - ここに画像の説明を入力

4

2 に答える 2

7

UIKit私たちのためにこれを適切に処理しないのは残念です。私自身のアプリdidRotateFromInterfaceOrientation:では、View Controller にメソッドを実装することでこれを処理し、ビューの更新されたフレームを使用してポップオーバーを再表示します。

于 2012-12-04T19:59:50.980 に答える