UIActionSheet showFromRect Autorotation

ios, ios5

Solution

It's a shame `UIKit` doesn't properly handle this for us. In my own app I handle this by implementing the `didRotateFromInterfaceOrientation:` method in my view controller and reshow any popover again using the updated frame of the view.

Problem

I'm showing a `UIActionSheet` like this: ``` -(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]; } ``` Where the `sender` object is a `UIButton` embedded in a `UITableViewCell`'s accessory view. The problem is when the iPad is rotated the actionsheet is not resizing (I don't expect it to actually RESIZE but I want it to be in the correct X,Y) I tried setting the AutoResizingMask to FlexibleLeft and FlexibleTop but it doesn't seem to change. Does anyone have any idea on how to get the actionSheet to point to the `accessoryView` after auto-rotation? Here is what it looks like: Before Rotation- After Rotation -

Original source