iphone - UIActionSheet 和 UITabBar 之间的奇怪错误
在我的标签栏应用程序中,我从一个操作中调出一个 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];
In my tabbar app, i bring up a UIActionsheet from an action, called from a button in a navigation controller title bar.
The UIActionsheet functions as per normal, except for the bottom half of the below button 'cancel', which strangely doesnt respond to touch in the iPhone Simulator. The bottom half of the cancel button is where the UITabBar lies behind, and therefore is probably the problem.
Any ideas?
alt text http://img12.imageshack.us/img12/2166/screenshot20100119at236.png
Solution
My solution was from the first answer. Here is my working example code
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:message delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"OK" otherButtonTitles:nil];
actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
[actionSheet showInView:[UIApplication sharedApplication].keyWindow];
[actionSheet release];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对我来说,这看起来像一个 UIActionSheet...
无论如何,您应该将操作表显示为应用程序窗口的子视图,而不是当前视图的子视图。
This looks like an UIActionSheet to me...
Anyway, you should show the action sheet as a subview of the application window, not of the current view.