问题描述
我有一个的UIButton BN 和UIActivityIndicator AI 这是上面的按钮( ai.center = bn.center
)。
I have an UIButton "bn" and an UIActivityIndicator "ai" which is above the button (ai.center = bn.center
).
只要 AI 是可见的,生动活泼的,我不能preSS的按钮下方的 AI的框架,但发现我能在范围之内。
As long as ai is visible and animating, I can't press the Button underneath ai's frame but out of the range I can.
我必须GestureRecognition添加到 AI 或有点击的一个更聪明的方式 AI
Do I have to add GestureRecognition to ai or is there a smarter way to click on the "ai".
亲切的问候。 $ H @ RKY
Kind regards. $h@rky
推荐答案
你能简单的设置 ai.userInteractionEnabled = NO;
?我很惊讶,这是无论如何启用,在一个活动的指标 - 这是一个标准的组件或已经你做一个子类?
Can you simply set ai.userInteractionEnabled = NO;
? I'm surprised it is enabled anyway, on an activity indicator - is this a standard component or have you made a subclass?
顺便说一句,它通常是差的用户界面设计为具有被另一个视图覆盖的交互式元件,尤其是其中一个用来指示的东西是忙,但在一个可点击的缩略图图像的示例,它似乎是有道理的。
As an aside, it is usually poor UI design to have an interactive element that is covered by another view, particularly one which is used to indicate that something is "busy", but in your example of a clickable thumbnail image, it seems to make sense.
这篇关于活动指示灯上方按钮prevents点击确认的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!