首页 > 技术文章 > Adding other views to UIButton

Clin 2013-10-23 17:31 原文

Q:

I want to add some views to UIButton, for example multiple UILabels, UIImages etc. One I add those view they do not get the touch events. How can I pass the touch events to UIButton?

Thanks

--------

A:

Set the userInteractionEnabled property of each of the subviews you added to your UIButton to NO.

推荐阅读