最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
自定义AlertDialog去除黑色背景的解决方法
时间:2022-06-25 22:52:52 编辑:袖梨 来源:一聚教程网
主要注意的是在资源引用的地方
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();
}
});
}
相关文章
- poipiku网站如何打开-poipiku官网网页版访问入口 01-06
- uc网盘网页版官方入口-UC网盘网页版快捷登录 01-06
- 全免费影视软件哪个最好用-全免费电视电影软件推荐 01-06
- 悟空浏览器怎样直接打开网页-悟空浏览器一键直达网页技巧分享 01-06
- 谷歌google官方入口-Google官方网站入口 01-06
- 漫画天堂最新版本下载入口-漫画天堂官方正版下载入口汇总 01-06
