UIBarButtonItem 在 iOS 11 beta 7 上不可点击? [英] UIBarButtonItem not clickable on iOS 11 beta 7?

查看:42
本文介绍了UIBarButtonItem 在 iOS 11 beta 7 上不可点击?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于这个还有另一个关于 SO 的问题,但这与它无关,因为我认为这与 iOS 11 的 beta 版本有关.

There is another question on SO about this but this has nothing to do with it because I think this has to do with a beta version of iOS 11.

我有这 2 个 UIButton,它们被分组在一个 UIView 中.这个 UIView 被放在一个 UIBarButtonItem 中,整个东西被设置为 Left Bar Button Items,使用 Interface Builder.

I have these 2 UIButtons that are grouped inside a UIView. This UIView is put inside a UIBarButtonItem and the whole thing is set as Left Bar Button Items, using Interface Builder.

每个按钮在单击时都会显示一个由情节提要触发的弹出框.

Each button, when clicked, show a popover, triggered by storyboard.

我正在使用 Xcode 8 运行 iOS 9 的 iPad 3 上进行测试.效果非常好.

I am testing this on an iPad 3, running iOS 9, using Xcode 8. This works wonderfully.

现在我决定在运行 iOS 11 beta 7 的 iPad Pro 9.7" 上进行测试.我使用的是 Xcode 9 beta 6.当我在 iPad Pro 上运行它时,导航栏上的所有按钮都已失效.他们不响应点击.现在我尝试使用相同的 Xcode 9 beta 6 并在装有 iOS 9 的 iPad 3 上运行该应用程序,并且再次运行良好.

Now I have decided to test this on my iPad Pro 9.7" that is running iOS 11 beta 7. I am using Xcode 9 beta 6. When I run this on the iPad Pro, all buttons on the navigation bar are dead. They don't respond to clicks. Now I try the same Xcode 9 beta 6 and run the app on the iPad 3 with iOS 9 and again, all work wonderfully.

我正在为 iOS 9.1 编译.

I am compiling for iOS 9.1.

按钮甚至不会像在 iOS 9 上那样突出显示以确认点击.

Buttons not even highlight to acknowledge the tap, as they do on iOS 9.

iOS 11 beta 7 和栏按钮项目是否存在问题?

Is there an issue with iOS 11 beta 7 and bar button items?

有什么想法吗?

推荐答案

我发现问题了!惊人的错误!

I have discovered the problem! Amazing bug!

这是演习.我这样做是在左侧导航项中添加两个按钮:

This is the drill. I was adding two buttons to the left navigation item by doing this:

  1. 创建视图
  2. 在该视图中添加两个 UIButtons.
  3. 将该视图添加到左侧导航项.

这是为 iOS 9 编译的,适用于 iOS 10 及更低版本但不适用于 iOS 11 的设备.

This was compiled for iOS 9 and works on a device with iOS 10 and below but not iOS 11.

这样做的正确"方式是这样的

The "correct" way of doing this is this

  1. UIButton 拖到左侧导航项.
  2. 将另一个 UIButton 拖到左侧导航项.
  1. Drag an UIButton to the left navigation item.
  2. Drag another UIButton to the left navigation item.

您会看到 iOS 允许这种情况发生,并将管理导航项"下的两个按钮.

You will see that iOS allows that to happen and will manage both buttons under "navigation items".

这适用于我从 9 到 11 测试过的所有 iOS 版本.

this will work on all iOS versions I have tested from 9 thru 11.

这篇关于UIBarButtonItem 在 iOS 11 beta 7 上不可点击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆