By Nikhil Muskur

2019-01-11 11:41:41 8 Comments

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)


@Daniel T. 2019-01-11 12:09:22

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

@Nikhil Muskur 2019-01-11 13:47:32

Thanks for the answer this was the issue. Changing the background color of the superview and checking it in the preview revealed the issue.

@Abdul Yasin 2019-01-11 15:50:47

Try setting clip to bounds to true for the superview.

Related Questions

Sponsored Content

7 Answered Questions

4 Answered Questions

[SOLVED] How to cancel UIGestureRecognizer if subview's button pressed

6 Answered Questions

[SOLVED] Gesture recognizer and button actions

3 Answered Questions

[SOLVED] IOS 9 - UIButton on subview does not fire IBAction outlet

2 Answered Questions

3 Answered Questions

0 Answered Questions

Animate Button frame along with superview animation

2 Answered Questions

[SOLVED] Intercept TouchUpInside event in UITableView while tableview scrolls

1 Answered Questions

[SOLVED] iOS UIButton outside Frame not firing touchinside event

2 Answered Questions

Sponsored Content