自定义界面的AlertDialog

版权声明:本文为博主原创文章,转载请注明出处 https://blog.csdn.net/a136447572/article/details/87972380
1  AlertDialog mAlertDialog;

2  View contentView = View.inflate(mContext, R.layout.alertDialogView, null);

3  this.mAlertDialog = new AlertDialog.Builder(mContext)
                                .setView(contentView)
                                .create();

    /**
     * 显示
     */
    public void show(){
        if(this.mAlertDialog != null){
            this.mAlertDialog.show();
        }
    }

    /**
     * 隐藏
     */
    public void hide(){
        if(this.mAlertDialog != null){
            this.mAlertDialog.hide();
        }
    }

猜你喜欢

转载自blog.csdn.net/a136447572/article/details/87972380