Android的AlertDialog,setView后去除黑色边框
来源:互联网 发布:管理数据的重要性 编辑:程序博客网 时间:2024/04/28 17:35
1、通过使用theme
AlertDialog.Builder builder = new Builder(new ContextThemeWrapper(_this,R.style.dialog_pwd));
确保我们创建的对话框是Dialog还是AlertDialog。因为会导致setView的方法出现不同。
AlertDialog是由dialog.setView(view,0,0,0,0);
Dialog时为dialog.setView(view);
例如:
首先定义style文件:
<style name="Theme_Transparent" 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>
然后java代码中:
AlertDialog.Builder builder = new Builder(new ContextThemeWrapper(_this, R.style.Theme_Transparent));dialog = builder.create();LayoutInflater inflater = (LayoutInflater) _this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);view = inflater.inflate(R.layout.activity_change_pwd, null);dialog.setView(view,0,0,0,0);
0 0
- Android的AlertDialog,setView后去除黑色边框
- Android的AlertDialog,setView后去除黑色边框
- 关于Android AlertDialog的setView
- Android自定义Dialog去除黑色边框
- android 自定义Dialog去除黑色边框
- android中AlertDialog 中setView用法的一些小结
- Android AlertDialog全屏显示去除白色边框
- QpushButton 去除外侧的黑色边框
- android 剪裁后的图片出现黑色边框
- Dialog去除黑色边框
- 自定义AlertDialog,去掉黑色边框
- 自定义AlertDialog去除黑色背景
- android 自定义dialog的实现(自定义大小、去除黑色边框等)
- Android 自定义dialog,去除系统默认黑色背景,边框并设置dialog的显示位置
- 关于AlertDialog的setView与setContentView区别
- Android中自定义AlertDialog,去除黑,白边框
- iOS之去除navigation bar下面的黑色边框
- 《转载》Android AlertDialog 方法setView(view,0,0,0,0)的使用
- response下载文件
- 以我个人一年的求职经历为主要经验来介绍(主要是开发岗位经验)地球人找工作之前期准备
- shell编程基础(3)条件判断语句
- iaas和paas常见技术
- Go语言panic和recover使用
- Android的AlertDialog,setView后去除黑色边框
- BlockingQueue队列详解
- 用代码设置控件的属性
- iOS 在UILabel显示不同的字体和颜色
- HTML的placeholder标签
- burpsuite proxy option running 勾选不了
- 深入SQLite多线程的使用总结详解
- Dialog实现背景虚化了
- JNI(Java Native Interface)调用非java类方法