当前位置:编程学习 > wap >>

dialogfragment弄了一个弹出alert框,白色背景消不掉,求助!!!


效果如图。
用shape写了个背景,作为填充,色值为#CF000000
dialog下面还有一层白色的背景,试了好多种方法,总是消不掉,求达人指点
背景我应该去掉了,但不清楚这个白色层属于那一层,如何设置属性,把他干掉啊?
PS:调用此dialogfragment的activity设置了android:theme="@android:style/Theme.Holo.Light.NoActionBar"主题,后来我尝试换为
android:theme="@android:style/Theme.Holo.NoActionBar"后面那一层就变为黑色了。求解 --------------------编程问答-------------------- 将dialog背景设置为空,透明的 --------------------编程问答-------------------- Light.NoActionBar改成Translucent.NoActionBar --------------------编程问答-------------------- 贴错了<item name="android:windowIsTranslucent">true</item><!-- 半透明 --> --------------------编程问答-------------------- 我刚刚试了一下Translucent.NoActionBar,囧,木有找到对应的选项,半透明我之前试过,是把整个窗口半透明了,我是想去掉后面那层白色的底哈。 --------------------编程问答-------------------- 支持一楼,设置背景为透明或空。 --------------------编程问答-------------------- 关于设置背景透明的方法,为了避免干扰,新建了一个test工程
结果如下:
<color name="transparent">#b000</color>
设置背景方法一:
<style name="CustomAlertDialogBackground" parent="@android:style/Theme.Holo.Light.Dialog">
  <item name="android:background">@color/transparent</item>
  <item name="android:windowBackground">@null</item>
</style>
设置背景方法二:
<style name="CustomAlertDialogBackground" parent="@android:style/Theme.Holo.Light.Dialog">
  <item name="android:background">@null</item>
  <item name="android:windowBackground">@color/transparent</item>
</style>
用AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.CustomAlertDialogBackground);加载这个style

方法一的结果:

方法二的结果:

不知道我的方法是否有错误。
我那个圆角处的白色底边依然还在,实际背景的区域好似也不是白色那一层,白边的问题依然不懂如何去掉,求解啊!!! --------------------编程问答-------------------- 除
补充:移动开发 ,  Android
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,