iPad – How do I display an action table in Popover?

I have a split view controller with a table view controller on the left. When I click the detail disclosure button of a table cell, how do I display the action in a pop-up window surface?
try this:

UIActionSheet *popupSheet = [[UIActionSheet alloc] initWithTitle:@"Title" 
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:@"No Way !"
otherButtonTitles:nil];

popupSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;
UIButton * disclosureButton = (UIButton *)cell.accessoryView;

[popupSheet showFromRect:disclosureButton.bounds inView:cell.accessoryView animated:YES];
[popupSheet release];

UIActionSheet docs indicate showFromRect: inView: animated: method:

displays the action sheet in a popover whose arrow points to the specified rectangle of the view (in our case the detail disclosure button). The popover does not overlap the specified rectangle.

I have a split view controller with a table view controller on the left. When I click the table cell When the detailed information of the grid is disclosed, how to display the operation table in the pop-up window?

Try this:

UIActionSheet *popupSheet = [[UIActionSheet alloc] initWithTitle:@"Title" 
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:@"No Way !"
otherButtonTitles:nil];

popupSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;
UIButton * disclosureButton = (UIButton *)cell.accessoryView;

[popupSheet showFromRect:disclosureButton.bounds inView:cell.accessoryView animated:YES];
[popupSheet release ];

UIActionSheet docs indicate showFromRect: inView: animated: method:

displays the action sheet in a popover whose arrow points to the specified rectangle of the view (in our case the detail disclosure button). The popover does not overlap the specified rectangle.

Leave a Comment

Your email address will not be published.