@Override
    public void onStart() {
        super.onStart();
        Window window = getDialog().getWindow();
        WindowManager.LayoutParams windowParams = window.getAttributes();
        windowParams.dimAmount = 0.0f;//Dialog外边框透明
        window.setLayout(windowParams.MATCH_PARENT, windowParams.WRAP_CONTENT); //高度自适应,宽度全屏
        windowParams.gravity = Gravity.CENTER; //在中间显示
//        windowParams.windowAnimations = R.style.top_dialog_anim;
        window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));//需要这一行来解决对话框背景有白色的问题(颜色随主题变动)
        window.setAttributes(windowParams);

    }
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
        Window mWindow = getDialog().getWindow();
        mWindow .requestFeature(Window.FEATURE_NO_TITLE);
       //    mViewContent = inflater.inflate(R.layout.ugckit_layout_joiner_progress, null);
        }
Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐