public void showAlert(){
LayoutInflater inflater = getLayoutInflater();
View view = inflater.inflate(R.layout.alert, null);
TextView showText = (TextView)view.findViewById(R.id.text);
AlertDialog alert = new AlertDialog.Builder(this).create();
alert.show();
WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
layoutParams.width= LayoutParams.MATCH_PARENT;
layoutParams.height= LayoutParams.MATCH_PARENT;
showText.setText("hgfhjgfhkhj");
alert.getWindow().setAttributes(layoutParams);
alert.getWindow().setContentView(view);
}
做一个空的全屏的AlertDialog
最新推荐文章于 2023-12-09 20:52:35 发布