如何在Android Studio中为整个活动禁用或阻止触控? 我知道如何禁用单个或多个视图的触摸,但不知道如何为整个活动禁用它...
答案 0 :(得分:2)
使用它非常简单:
public testVariable:number;
test(){
console.log('fired');
var x =[1,2,3,4];
var self = this;
x.forEach(function (e){
self.testVariable = e;
})
console.log( this.testVariable);
}
然后回复:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE,
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
答案 1 :(得分:0)
阻止触摸事件
getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE,
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);