ipad - 如何在弹出窗口中显示操作表?

标签 ipad controller action popover

我有一个 Split View Controller ,其中左侧包含一个 TableView 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: 方法:

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.

关于ipad - 如何在弹出窗口中显示操作表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2847950/

相关文章:

ios - 两个应用试图在同一端口上启动 HTTP 服务器

javascript - Ui-view 不更新 Controller 中的值

php - Zend 似乎不想加载我创建的表单

android - Libgdx中如何让actors一个接一个做特定的 Action

javascript - 使用 javascript 形成两个 Action

ios - 使用 GDB 测试 iPad 应用程序挂起黑屏,在模拟器上正常

iphone - 持久的设备标识符,即使在应用程序被卸载后

iphone - iphone sdk 中的日期操作?

controller - 在Kubernetes Controller 中,从通知者缓存中获取项目的首选方法是什么?

ios - 打开指向可点击标签的链接 (RTLabel)