private View view ;
private AlertDialog alertDialog;
view = LayoutInflater.from(MymationActivity.this).inflate(R.layout.picker_sex_dialog_layout, null);//自定义布局
新建一个final AlertDialog.Builder builder =new AlertDialog.Builder(MymationActivity.this, AlertDialog.THEME_DEVICE_DEFAULT_DARK);
builder.setCancelable(false);
builder.setView(sexview); // 设置自己定义的布局文件作为弹出框的Content
alertDialog = builder.create();
alertDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
alertDialog = builder.show();
初始化布局的时候记得绑定当前的view ;
自己可以添加点击事件什么 完全于自己的控件
网友评论