UITableViewCell上的可选对象未响应iOS14上的用户输入 [英] Selectable objects on UITableViewCell not responding to user input on iOS14

查看:135
本文介绍了UITableViewCell上的可选对象未响应iOS14上的用户输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

虽然用XCode 12(目前是beta 5是最新版本)编译几个项目并在iOS14上运行它们,但我注意到UIButtonUITextField和许多其他可选对象没有响应在UITableViewCell内时输入用户输入.

While compiling a couple of projects with XCode 12 (beta 5 is the latest version at the moment) and running them on iOS14, I've noticed that UIButton, UITextField, and many other selectable objects are not responding to user input when inside of a UITableViewCell.

在某些情况下,可以通过将对象放在前面(object.bringToFront())来解决此问题,但这不适用于我所遇到的所有情况.当我使用调试视图层次结构"时,我还注意到单元格组件顶部的空白视图(层).工具. XCode 11版本中不存在此视图.这是我缺少的一些新单元配置吗?是否有禁用此行为的标准方法,还是我必须精打细算才能解决此问题?

In some cases, it is possible to work around the issue by bringing the object to the front (object.bringToFront()), but this is not working for all the cases I'm facing. I've also noticed an empty view (layer) on top of the components of the cell when I use the "Debug View Hierarchy" Tool. This view is not present on XCode 11 builds. Is this some new cell configuration that I'm missing? Is there a standard way of disabling this behavior or will I have to be hacky to fix this?

PS:使用XCode 11(或更早版本)编译时,即使在iOS14上运行,同一项目上也不存在这些问题.

PS: The issues were not present on the same projects when compiled with XCode 11 (or previous), even when running on iOS14.

推荐答案

所有选择响应问题都可能是由于在UITableviewCell上添加子视图引起的.正确的方法是在UITableViewCell.contentView上添加,请先进行检查.

All the select response issue may caused by adding subview on UITableviewCell. The right way is add on UITableViewCell.contentView, check it first.

这篇关于UITableViewCell上的可选对象未响应iOS14上的用户输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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