为什么点一下就消失了
代码如下
var ctx=com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctx.runOnUiThread(new java.lang.Runnable({run:function(){try{
var $1=new android.widget.LinearLayout(ctx);
$1.setOrientation(0);
var $2=new android.widget.Button(ctx);
$2.setText("FIRE");
$2.setGravity(119);
$2.setOnClickListener(new android.view.View.OnClickListener({onClick:function(){
clientMessage("此功能正在开发");
}}));
var $2_params=new android.widget.LinearLayout.LayoutParams(-2,-2);
$2.setLayoutParams($2_params);
$1.addView($2);
var $3=new android.widget.EditText(ctx);
$3.setText("HI MINECRAFT");
var $3_params=new android.widget.LinearLayout.LayoutParams(-2,-2);
$3.setLayoutParams($3_params);
$1.addView($3);
var $=new android.widget.PopupWindow(ctx);
$.setFocusable(true);
$.setContentView($1);
$.setWidth(200);
$.setHeight(95);
$.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(922919911));
$.showAtLocation(ctx.getWindow().getDecorView(),0,304,235);
}catch(e){print(e)}}}));
代码如下
var ctx=com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctx.runOnUiThread(new java.lang.Runnable({run:function(){try{
var $1=new android.widget.LinearLayout(ctx);
$1.setOrientation(0);
var $2=new android.widget.Button(ctx);
$2.setText("FIRE");
$2.setGravity(119);
$2.setOnClickListener(new android.view.View.OnClickListener({onClick:function(){
clientMessage("此功能正在开发");
}}));
var $2_params=new android.widget.LinearLayout.LayoutParams(-2,-2);
$2.setLayoutParams($2_params);
$1.addView($2);
var $3=new android.widget.EditText(ctx);
$3.setText("HI MINECRAFT");
var $3_params=new android.widget.LinearLayout.LayoutParams(-2,-2);
$3.setLayoutParams($3_params);
$1.addView($3);
var $=new android.widget.PopupWindow(ctx);
$.setFocusable(true);
$.setContentView($1);
$.setWidth(200);
$.setHeight(95);
$.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(922919911));
$.showAtLocation(ctx.getWindow().getDecorView(),0,304,235);
}catch(e){print(e)}}}));