去掉AlertDialog边框的方法
来源:互联网 发布:qt 调用dotnet 编程 编辑:程序博客网 时间:2024/06/05 08:59
private AlertDialog.Builder mVerBuilder;
private View mViewVer;
mVerBuilder = new AlertDialog.Builder(this, R.style.newPassword);
final AlertDialog alert = mVerBuilder.create();
LayoutInflater layoutInflater = LayoutInflater.from(this);
mViewVer = layoutInflater.inflate(R.layout.systemversion, null);
alert.setView(mViewVer);
alert.show();
WindowManager.LayoutParams lp = alert.getWindow().getAttributes();
lp.width = (int)getResources().getDimension(R.dimen.installation_dialog_width);
lp.dimAmount = ContactsUtil.DIM_AMOUNT_TRANSLUCENT;
alert.getWindow().setAttributes(lp);
alert.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
其中,R.style.newPassword就是去掉边框的关键,它的定义在res/values/style.xml里,内容如下:
<style name="newPassword" parent="@android:Theme.DeviceDefault.Light.Dialog">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
</style>
阅读全文
0 0
- 去掉AlertDialog边框的方法
- 自定义AlertDialog,去掉黑色边框
- UIWebView 去掉边框的方法
- IOS UIWebView去掉边框的方法
- C#中去掉Toolstrip边框的方法
- C#中去掉Toolstrip边框的方法
- table边框完全去掉的方法
- 关于 Swift segmentController 去掉边框的方法
- C#中去掉Toolstrip边框的方法
- Android自定义AlertDialog去掉黑边的方法
- 去掉panel的边框
- 去掉菜单的边框
- 去掉虚拟的边框
- 去掉input的边框
- 去掉 DataList 的边框
- 去掉iframe的边框
- 去掉html里面的边框的简单方法
- 图片有带颜色的边框,去掉方法
- SSM框架搭建
- 应用启动时间统计方法
- surfacetexture与camera结合基本流程
- ajax的登录处理
- Android RecyclerView (十)组件化封装
- 去掉AlertDialog边框的方法
- 项目中使用Shiro出现空指针异常的问题
- 编辑图片时,能够实时显示上传的图片(预览)
- jsp中的cookie与session的区别
- Java集合框架之Map---HashMap和LinkedHashMap源码分析
- matlab 二分法
- 枚举的定义和使用
- ts、js自定义方法,实现延迟
- flex布局1