您的位置:首页 > 其它

设置dialog形式的activity背景有黑框的问题处理

2014-04-01 17:10 387 查看
今天在开发过程中发现主题设为dialog的activity总会出现一个黑框,在布局文件中无法去掉,于是只能修改activity的主题设置
<style name="translucent" parent="@android:style/Theme.Dialog">
         <item name = "android:windowBackground">@color/translucent_background</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowNoTitle">true</item>
       
        <item name="android:windowAnimationStyle">@+android:style/Animation.Translucent</item>
    </style>
颜色
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="translucent_background">#00000000</color>
</resources>

这样引入主题translucent作为activity的theme就解决了标题的问题。

究其原因是因为dialog这个主题有默认的背景设置。。。。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: