如何在popover中显示一个动作表?

Shw*_*eta 7 action controller popover ipad

我有一个拆分View控制器,左侧有一个表视图控制器.当我单击表格单元格的详细信息披露按钮时,如何在弹出窗口中显示操作表?

Ibr*_*rim 15

试试这个 :

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];
Run Code Online (Sandbox Code Playgroud)

所述UIActionSheet文档指出的showFromRect:inView:animated:方法:

在弹出窗口中显示操作表,其中箭头指向视图的指定矩形(在我们的示例中为详细信息公开按钮).弹出窗口不与指定的矩形重叠.