我有一个拆分的View Controller ,其中左侧包含一个表格 View Controller 。单击表格单元格的详细信息披露按钮时,如何在弹出窗口中显示操作表?

最佳答案

试试这个 :

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 声明 showFromRect:inView:animated: 方法:

10-05 23:04