Obj-C,为什么我的 UIActionSheet 取消按钮很难点击?
我注意到在我的应用程序中,我的取消按钮很难点击,似乎点击区域不在中心。
我该如何解决这个问题?
这是我的代码...
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@""
delegate:dg
cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil
otherButtonTitles: @"Help Pages", @"Tutorial",
@"Feedback / Questions ", @"Facebook Group", @"About", nil];
actionSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[actionSheet setTag:CommonUIActionSheetHelp];
[actionSheet showInView:vw];
[actionSheet release];
I've noticed in my app that my cancel button is hard to tap, it seem like the hit area is not in the center.
How do I fix this ?
Heres my code...
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@""
delegate:dg
cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil
otherButtonTitles: @"Help Pages", @"Tutorial",
@"Feedback / Questions ", @"Facebook Group", @"About", nil];
actionSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[actionSheet setTag:CommonUIActionSheetHelp];
[actionSheet showInView:vw];
[actionSheet release];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为你的问题出在
[actionSheet showInView:vw];
上,也许你在应用程序中使用 tabBarController/toolBar(在底部),此时就会发生此错误。您应该根据您的设计使用
showFromToolbar
或showFromTabBar
。如果您的设计不同,请注明。(如果那里没有 tabBar/toolBar)。谢谢
I think your problem lies in the
[actionSheet showInView:vw];
, perhaps you are using tabBarController/toolBar in you application(at bottom), this error occurs at that time.you should use either
showFromToolbar
orshowFromTabBar
as per your design. If your design is different then please mention it.(if no tabBar/toolBar there).Thanks
同意拉文的回答,你可以尝试
一下,也有帮助
agree whit Ravin answer and you can try
it can help also
我在 iOS 8 中遇到类似的问题,使用带有
UIAlertControllerStyleActionSheet
样式的UIAlertController
。问题是操作表上的第一次点击被忽略。
事实证明,这与我的文本字段的键盘干扰触摸有关。
解决方法是先关闭键盘,然后显示操作表。
I have similar problem in iOS 8, using
UIAlertController
with styleUIAlertControllerStyleActionSheet
.The problem is that the first tap on the action sheet is ignored.
Turned out it got to do with my text field's keyboard interfering with the touches.
The fix is to dismiss the keyboard first, then present the action sheet.