简体   繁体   中英

TouchUpInside event not firing for the entire button frame

I have simple button with image, it has fixed width and height of 110.

So the issue is that the touchUpInside event is only firing if I click on the top 20% on the button if click below that nothing is trigged not even a tap gesture on the button.

After searching, most of the solutions suggested that if a view block's the button's frame the touch event may not pass through, but I don't have anything of that sort of. The buttons are subview of the root view.

I also checked I don't have any gesture recogniser used on my View Controller.

So can anybody point me in the right direction to resolve this issue.

And this issue is happening with other standard UIControls as well (eg : DatePicker only the upper part of Picker view is scrollable the bottom part is not active)

Most likely, your button is not fully in its superview. Make sure that the button's superview is larger than the button.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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