问题标签 [setuserinteractionenabled]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
149 浏览

ios - 覆盖块上的 userInteractionEnabled 会阻止 UIView 下方的 touchEvents

在 iOS 应用程序中,我有一个包含 UIScrollView 的 UIView 和一个具有一定透明度的覆盖 UIImageView。
覆盖视图位于 UIScrollView 之上,并将 userInteractionEnabled 设置为 YES。
我可以正确接收覆盖层上的触摸事件,但滚动视图不再获取它们。

当 userInteractionEnabled si 在叠加层上设置为 NO 时,我可以在 UIScrollView 中正确平移,但显然叠加层不再获得触摸事件。

如何能够将触摸事件从叠加层传递到滚动视图,以便我仍然可以滚动或平移滚动视图?

我已经从覆盖中尝试过,但它不起作用:

0 投票
0 回答
40 浏览

ios - iOS:为什么 [self.view setUserInteractionEnabled:NO] 正在更改我的班级地址?

我在一个类中使用该属性:

当我在主函数中使用该代码时: form = formToSend;

以及子函数中的代码:

它改变了表单类的地址。在 [self.view setUserInteractionEnabled:NO] 之前

[self.view setUserInteractionEnabled:NO] 之后

我避免该问题的解决方案,但我什至想了解为什么...

有什么解释吗?

0 投票
0 回答
170 浏览

swift - Swift - isUserInteractionEnabled = false 但启用 2 个手势

我想阻止与用户的交互,但双击取消除外。是否可以在下面为我的双击线添加isUserInteractionEnabled = false 和例外规则?

--

谢谢!