AlertDialog制作圆角 背景有直角问题
来源:互联网 发布:sqlserver exists 编辑:程序博客网 时间:2024/06/08 01:40
问题:一般在使用弹窗的时候,为了美观都会设计成圆角边框,但是圆角边框的同时会出现白色直角部分。
下面是一个AlertDialog ,特别注意红色的部分,加上红色的这两行,就是将弹窗的背景设置为透明色(#00000000)
AlertDialog dialog;private void showConfirm() { AlertDialog.Builder builder=new AlertDialog.Builder(context); View view=LayoutInflater.from(context).inflate(R.layout.dialog_pay_confirm,null); TextView confirm= (TextView) view.findViewById(R.id.tv_pay_confirm); builder.setView(view); dialog = builder.create(); Window window=dialog.getWindow(); window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); confirm.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { dialog.dismiss(); } }); dialog.show();}
设置圆角的xml
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:radius="15dp"/> <stroke android:width="2dp" android:color="@color/colorPrimary" /> <!-- 填充颜色 --> <solid android:color="#ffffffff" /></shape>
阅读全文
0 0
- AlertDialog制作圆角 背景有直角问题
- 制作圆角背景
- AlertDialog自定义界面圆角有背景问题
- 直角多边形添加圆角
- 关于alertdialog显示问题,显示有延迟
- 直角图片进行圆角处理
- ios 直角和圆角 并存
- android上面圆角,下面直角 ImageView
- Bootstrap 按钮圆角改成直角
- Xcode9模拟器圆角切换成直角
- Imageview上边圆角,下边直角
- 制作有背景图案的TreeView
- 关于AlertDialog的背景
- AlertDialog 自定义背景分析
- AlertDialog 自定义背景
- alertDialog的背景自定义
- 改变AlertDialog默认背景
- AlertDialog 背景透明
- Servlet基础(二):Servlet与JSP
- 百练OJ:2728:第一个C++程序
- sql把行带有逗号的转化为列-尘缘晖
- 并查集:HDU5326-Work(并查集比较简单灵活的运用)
- Dataframe的使用方法
- AlertDialog制作圆角 背景有直角问题
- java初学者的浅谈(5)StringBuffer类和StringBuilder类
- TCP三次握手详解及释放连接过程
- poi导出excel 之API整理
- 创建只能看到自己有权限库的登录名和用户
- javascript动画特效 多透明度 源代码
- Laravel框架一:原理机制篇
- mysql :ERROR 1820 (HY000)
- 自己封装的Mysql数据库操作模块