Why does UINavigationBar steal touch events?

后端 未结 12 2565
耶瑟儿~
耶瑟儿~ 2020-11-27 18:48

I have a custom UIButton with UILabel added as subview. Button perform given selector only when I touch it about 15points lower of top bound. And when I tap above that area

12条回答
  •  隐瞒了意图╮
    2020-11-27 19:15

    There are 2 things that might be causing problems.

    1. Did you try setUserInteractionEnabled:NO for the label.

    2. Second thing i think might work is apart from that after adding label on top of button you can send the label to back (it might work, not sure although)

      [button sendSubviewToBack:label];

    Please let me know if the code works :)

提交回复
热议问题