自定义Dialog调整宽高大小

    private void showDialog(View view) {
        dialog = new Dialog(mActivity, R.style.AlertDialogTheme);
        dialog.setContentView(view);
        
        display = mActivity.getWindowManager().getDefaultDisplay();
        Window window = dialog.getWindow();
        WindowManager.LayoutParams attributes = window.getAttributes();
        attributes.width = (int) (display .getWidth() * 0.8);
        window.setAttributes(attributes);

        dialog.show();
    }


    

至于布局、圆角就要自己写资源文件来实现了。

你可能感兴趣的:(Android)