【android】把AlertDialog后面黑背景设置全透明,昏暗度为0
2016-09-14 15:40
441 查看
核心代码:
dialog.getWindow().setDimAmount(0);//设置昏暗度为0
public void showDialog(){
AlertDialog dialog = new AlertDialog.Builder(getContext()).create();
dialog.getWindow().setDimAmount(0);//设置昏暗度为0
dialog.setCanceledOnTouchOutside(true);
dialog.show();
//设置自定义布局,必须要在show之后
dialog.getWindow().setContentView(R.layout.layout_menu_black);
}
效果图:
dialog.getWindow().setDimAmount(0);//设置昏暗度为0
public void showDialog(){
AlertDialog dialog = new AlertDialog.Builder(getContext()).create();
dialog.getWindow().setDimAmount(0);//设置昏暗度为0
dialog.setCanceledOnTouchOutside(true);
dialog.show();
//设置自定义布局,必须要在show之后
dialog.getWindow().setContentView(R.layout.layout_menu_black);
}
效果图:
相关文章推荐
- Android UI设计之AlertDialog弹窗控件
- Android编程之自定义AlertDialog(退出提示框)用法实例
- Android使用自定义alertdialog实现确认退出按钮
- Android中AlertDialog用法实例分析
- Android中阻止AlertDialog关闭实例代码
- Android AlertDialog对话框用法示例
- Android中AlertDialog的六种创建方式
- Android修改源码解决Alertdialog触摸对话框边缘消失的问题
- Android实现点击AlertDialog上按钮时不关闭对话框的方法
- 简析Android多种AlertDialog对话框效果
- Android入门之AlertDialog用法实例分析
- Android中AlertDilog显示简单和复杂列表的方法
- 在Mac上用monodevelop使用黑色样式。编译使用monodevelop 6.0
- PIE使用阴影后的背景透明方法
- Android设置窗体Activity背景透明
- Android入门-AlertDialog
- Android学习笔记-Lesson 4: Favorite Twitter Searches Ap
- 透明颜色背景的制作
- 为自定义的ListView的条目添加对话框
- UITableViewHeaderFooterView背景透明