简体   繁体   English

UITableViewCell 上的可选对象不响应 iOS14 上的用户输入

[英]Selectable objects on UITableViewCell not responding to user input on iOS14

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 .在使用 XCode 12(beta 5 是目前的最新版本)编译几个项目并在 iOS14 上运行它们时,我注意到UIButtonUITextField和许多其他可选对象在UITableViewCell

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.在某些情况下,可以通过将 object 放在前面(object.bringToFront())来解决这个问题,但这并不适用于我面临的所有情况。 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.此视图不存在于 XCode 11 构建中。 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: The issues were not present on the same projects when compiled with XCode 11 (or previous), even when running on iOS14. PS:当使用 XCode 11(或更早版本)编译时,即使在 iOS14 上运行,这些问题也不会出现在相同的项目中。

All the select response issue may caused by adding subview on UITableviewCell .所有 select 响应问题可能是由于在UITableviewCell上添加子视图引起的。 The right way is add on UITableViewCell.contentView , check it first.正确的方法是在UITableViewCell.contentView上添加,先检查一下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM