@Override
  public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
      @Nullable Bundle savedInstanceState) {
    getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));//1.必须设置dialog的window背景为透明颜色,不然圆角无效或者是系统默认的颜色
    return inflater.inflate(R.layout.dialog_pay_sure_alert, container);
  }

<FrameLayout  //2.必须布局文件最外层包裹一层,这样才能显示指定的对话框大小,比如这里的 380dp x 205dp
xmlns:andro>
</android.support.constraint.ConstraintLayout>
</FrameLayout>

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:andro/>
</shape>
</item>
</layer-list>
 

 

相关文章:

  • 2022-12-23
  • 2021-08-08
  • 2021-04-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-08
  • 2022-01-26
  • 2021-12-11
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案