自定义AlertDialog去除黑色背景的解决方法
发布时间:2020-08-22 23:49:43
来源:脚本之家
阅读:120
作者:wapchief
主要注意的是在资源引用的地方
AlertDialog.Builder(this,R.style.dialogNoBg).create();
这里要自定义sytle
#00000000
@android:color/transparent
true
true
如果引用后还是没效果,
在自定义的布局里面根Layout布局背景设置为”#00000000”
源代码:
private AlertDialog dialog;
private void showdialogCashOut() {
dialog = new AlertDialog.Builder(this,R.style.dialogNoBg).create();
View view = View.inflate(this, R.layout.cash_see_out_dialog, null);
dialog.getWindow().setContentView(view);
TextView tv_money = (TextView) dialog.findViewById(R.id.tv_money);
tv_money.setText(Html.fromHtml("注意:"+getResources().getString(R.string.cash_out_dialog)));