iphone - ios UIActionSheet 取消按钮不能正常工作

标签 iphone ios objective-c uiactionsheet cancel-button

我有这个问题: 这是我的代码:

UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:@"Share the race" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Send with mail" otherButtonTitles:nil];
    popupQuery.actionSheetStyle = UIActionSheetStyleBlackTranslucent;
    [popupQuery showInView:self.view];
    [popupQuery release];

一切似乎都正常,2 个按钮显示正确,“发送邮件”按钮正常,但取消只在上侧捕捉到点击... 这是一个说明情况的镜头:

error click!

我该如何解决这个问题?

谢谢:)

最佳答案

我的猜测是 UIActionSheet 的底部超出了 View 的范围,因此不响应触摸。

为了检验这个理论,添加另一个按钮,看看是否所有上面的按钮都工作正常但底部按钮仍然表现出这种行为。

要解决此问题,请确保 View 延伸到屏幕底部。如果您的应用程序中有一个 tabBar,那将是我怀疑的问题所在。您可以使用 showFromTabBar: 如果您希望工作表位于 tabBar 上方,或者使用 showFromToolbar: 从工具栏显示它。

如果你没有底栏,那我就错了,我不知道。

关于iphone - ios UIActionSheet 取消按钮不能正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6699909/

相关文章:

ios - 按下时以编程方式移除 UIBarButtonItem 上的灯光?

ios - 不兼容的操作数类型 ('NSUInteger'(又名 'unsigned long')和 'id _Nullable')

iphone - 使用 reloadData 作为 UITableView 的保险单

iphone - 将 XIB 从变量切换到 View Controller

iOS:二元运算符 '|=' 不能应用于两个 'Bool' 操作数

ios - 无法访问 UICollectionViewCell 中的 UITextField

ios - 对对象的引用返回 null(iOS 类继承)

iphone - 设置缓冲速率 MPMoviePlayerController

iphone - 圆形CG点位置

iphone - 核心数据删除对象函数