在我的标签栏应用程序中,我从一个操作中调出一个 UIActionsheet,该操作是从导航 Controller 标题栏中的按钮调用的。
UIActionsheet 的功能正常,除了下面按钮“取消”的下半部分,奇怪的是它对 iPhone 模拟器中的触摸没有响应。取消按钮的下半部分是 UITabBar 后面的位置,因此可能是问题所在。
有什么想法吗?
alt text 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];
最佳答案
对我来说这看起来像一个 UIActionSheet...
无论如何,您应该将操作表显示为应用程序窗口的 subview ,而不是当前 View 的 subview 。
UIActionSheet *actionSheet = [[UIActionSheet alloc] init...];
// ...
[actionSheet showInView:[UIApplication sharedApplication].keyWindow];
关于iphone - UIActionSheet 和 UITabBar 之间的奇怪错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2096852/