什么可能导致 UIActionSheet 上的按钮“错过”关于触摸?

发布于 2024-08-29 06:52:23 字数 608 浏览 4 评论 0原文

我有一个 UIActionSheet 如下:

UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:[NSString stringWithFormat: @"Cancel New %@? Changes will be lost.", [creator propertyName]] delegate:self cancelButtonTitle:@"Stay Here" destructiveButtonTitle:@"Discard and Close" otherButtonTitles:@"Save and Close", nil];
[sheet showInView:self.view];
[sheet release];

它创建操作表,按钮显示,破坏性按钮位于顶部,取消按钮位于底部,其他按钮(保存和关闭)显示在中间,

顶部两个按钮,(破坏性和其他)工作正常,但底部按钮有一个间隙,因此它比其他按钮更向下。但出于某种原因,为了按下按钮,我需要触摸如果没有间隙的话它所在的位置。触摸实际按钮不起作用。

抱歉,如果这不是很清楚,有人遇到过这样的事情吗?我不喜欢太快地拿出“我发现了一个错误”卡,也许我在这里做错了什么。

I have a UIActionSheet as follows:

UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:[NSString stringWithFormat: @"Cancel New %@? Changes will be lost.", [creator propertyName]] delegate:self cancelButtonTitle:@"Stay Here" destructiveButtonTitle:@"Discard and Close" otherButtonTitles:@"Save and Close", nil];
[sheet showInView:self.view];
[sheet release];

It creates the action sheet, The buttons display, the Destructive button is on top, cancel button is on the bottom, other button (save and close) shows up in the middle,

the top two buttons, (destructive and other) work fine, but the bottom button has a gap, so it is farther down than the other buttons. For some reason though, in order to press the button I need to touch where it would be if there was no gap. Touching the actual button doesn't work.

Sorry if this isn't super clear, has anyone encountered something like this? I don't like to whip out the "I found a bug" card too fast, maybe I'm doing something wrong here.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

毁梦 2024-09-05 06:52:23

您可能会在选项卡栏控制器的视图中显示操作表。

操作表显示在选项卡栏上方,但触摸不会在选项卡栏占据的区域中注册。

尝试使用

[sheet showFromTabBar:self.tabBarController.tabBar];

Its likely that you're showing the action sheet in a view that is in a tab bar controller.

The action sheet appears above the tab bar, but touches aren't registered in the area that the tab bar occupies.

Try using

[sheet showFromTabBar:self.tabBarController.tabBar];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文