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

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

问题描述

关于此还有另一个问题,但这与它无关,因为我认为这与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 内,并使用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 beta6.在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天全站免登陆