美文网首页
使用CardView设置dialog圆角,背景还是有直角解决办法

使用CardView设置dialog圆角,背景还是有直角解决办法

作者: 明年的我会感谢今年的我 | 来源:发表于2020-06-20 12:09 被阅读0次

使用CardView作为dialog的布局,设置圆角度后发现背景还有直角,这是因为dialog默认内容背景是白色,需要把背景设为透明。
如:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
AlertDialog circularDialog = builder.create();
circularDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);

相关文章

网友评论

      本文标题:使用CardView设置dialog圆角,背景还是有直角解决办法

      本文链接:https://www.haomeiwen.com/subject/camwxktx.html