简体   繁体   English

自定义UITableViewCell不响应textLabel触摸

[英]Custom UITableViewCell doesn't respond on textLabel touches

I have custom UITableViewCell . 我有自定义UITableViewCell It contains UITextLabel . 它包含UITextLabel When I press this cell over the label it doesn't respond, but if I touch it on empty area, then is responds. 当我在标签上按下这个单元格时它没有响应,但是如果我在空白区域触摸它,则响应。 What might be the problem? 可能是什么问题?

My Cell is made in IB, User Interaction is enabled. 我的Cell是在IB中制作的,启用了用户交互。 Also, I've noticed that this problem happens only on iPad, on iPhone everything works perfectly fine! 此外,我注意到这个问题只发生在iPad上,在iPhone上一切正常!

转到CustomCell的IB并禁用标签的userinteraction。

check the frame of your textLabel. 检查textLabel的框架。 If the frame of your textLabel is exceeding your UITableViewCell, it will not respond to touch events. 如果textLabel的框架超出了您的UITableViewCell,它将不会响应触摸事件。

问题是在UITableView上有另一个视图

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

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