4

在我的标签栏应用程序中,我从一个操作中调出 UIActionsheet,从导航控制器标题栏中的按钮调用。

UIActionsheet 的功能正常,除了下面的按钮“取消”的下半部分,奇怪的是它对 iPhone 模拟器中的触摸没有响应。取消按钮的下半部分是 UITabBar 所在的位置,因此可能是问题所在。

有任何想法吗?

替代文字 http://img12.imageshack.us/img12/2166/screenshot20100119at236.png

解决方案

我的解决方案来自第一个答案。这是我的工作示例代码

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:message delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"OK" otherButtonTitles:nil];
        actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
        [actionSheet showInView:[UIApplication sharedApplication].keyWindow];
        [actionSheet release];
4

1 回答 1

19

这对我来说看起来像一个 UIActionSheet ......

无论如何,您应该将操作表显示为应用程序窗口的子视图,而不是当前视图的子视图。

UIActionSheet *actionSheet = [[UIActionSheet alloc] init...];

// ...

[actionSheet showInView:[UIApplication sharedApplication].keyWindow];
于 2010-01-19T20:40:48.730 回答