简体   繁体   English

TouchUpInside事件未触发整个按钮框架

[英]TouchUpInside event not firing for the entire button frame

I have simple button with image, it has fixed width and height of 110. 我有一个带有图像的简单按钮,它的宽度和高度固定为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. 因此,问题在于,仅当我单击按钮顶部的20%时才触发touchUpInside事件,如果单击下面的按钮,则不会触发任何动作,甚至不会敲击按钮。

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. 我还检查了我的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) 这个问题也发生在其他标准UIControls中(例如:DatePicker,只有Picker视图的上部是可滚动的,下部是不活动的)

Most likely, your button is not fully in its superview. 您的按钮最有可能未完全处于其超级视图中。 Make sure that the button's superview is larger than the button. 确保按钮的视图大于按钮。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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