读书人

随意地方显示对话框

发布时间: 2012-08-21 13:00:22 作者: rapoo

任意地方显示对话框

AlertDialog.Builder builder = new AlertDialog.Builder(this);   LayoutInflater inf = getLayoutInflater();    View layout = inf.inflate(R.layout.main, null);    builder.setView(layout);    builder.setTitle("Add to Home screen");AlertDialog dialog = builder.create();    WindowManager.LayoutParams WMLP = dialog.getWindow().getAttributes();    int dialogOriginalHeight = WMLP.height;WMLP.height += 750;Log.i("XnY", "x="+WMLP.x+", y="+WMLP.y);WMLP.x = -10;   //x positionWMLP.y = -10;   //y positionLog.i("XnY", "x="+WMLP.x+", y="+WMLP.y);dialog.getWindow().setAttributes(WMLP);Log.i("POSITION", "POS::HEIGHT:"+WMLP.height);dialog.show();

读书人网 >移动开发

热点推荐