UIButton in a UITableView header ignores most touches

前端 未结 9 2504
盖世英雄少女心
盖世英雄少女心 2020-12-28 18:58

I\'ve got a button that I\'m adding as a subview of a table view\'s tableHeaderView. The button appears fine, and tap-and-holding on it works intermittently - for the most p

9条回答
  •  一整个雨季
    2020-12-28 19:20

    My situation was similar to Danny Hall's (the table header view was a UIImageView, and there was a UIButton which was a subview of the UIImageView). In my case, the problem appears to have been caused by the button being a subview of the image view. What worked for me was creating a UIView "containing" view, such that both the image view as well as the button were subviews of the "containing" view. strange.

提交回复
热议问题