setFinishOnTouchOutside(true);////////设置为true点击区域外消失
setContentView(R.layout.dialog_input_verify_code);
setToolbarVisiable(View.GONE);
finalLinearLayout iLayout_main = (LinearLayout)this.findViewById(R.id.dialog_input_verify_ll);
iLayout_main.getViewTreeObserver()
.addOnGlobalLayoutListener(newOnGlobalLayoutListener() {
@Override
public voidonGlobalLayout() {
intheight =iLayout_main.getMeasuredHeight();
WindowManager m = getWindowManager();
Display d = m.getDefaultDisplay();// 为获取屏幕宽、高
android.view.WindowManager.LayoutParams p = getWindow().getAttributes();
// p.height = (int) (d.getHeight() * 0.5); // 高度设置为屏幕的0.8
p.height= height;
p.width= (int) (d.getWidth() *0.8);// 宽度设置为屏幕的0.7
getWindow().setAttributes(p);
}
});