最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
自定义AlertDialog去除黑色背景的解决方法
时间:2018-07-30 编辑:猪哥 来源:一聚教程网
主要注意的是在资源引用的地方
AlertDialog.Builder(this,R.style.dialogNoBg).create();
这里要自定义sytle
如果引用后还是没效果,
在自定义的布局里面根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))); TextView cancle_ye = (TextView) view.findViewById(R.id.dialog_cancel); cancle_ye.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { dialog.dismiss(); } }); TextView yes_ye = (TextView) view.findViewById(R.id.dialog_yes); yes_ye.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { dialog.dismiss(); } }); }
相关文章
- kotlin gson反序列化默认值失效深入讲解 12-28
- Android使用Volley框架定制PostUploadRequest上传文件 12-26
- Android使用Volley实现上传文件功能 12-26
- Android自定义控件仿iOS滑块SwitchButton 12-26
- Android自定义控件实现带数值和动画的圆形进度条 12-25
- Android自定义控件实现折线图 12-25