2

我希望有一个活动的半透明背景,以便可以在此活动下方看到之前的活动。类似于在后台播放的视频上弹出的半透明菜单。

这可能吗?你能告诉我怎么做吗?

注意:我不能使用 android 的默认半透明主题,因为我正在为我的应用程序使用我自己的自定义背景和主题。

请帮忙。下面是我的 style.xml,其中 my_btn 和 my_list 是选择器:

<?xml version="1.0" encoding="utf-8"?>
<resources> 
    <style name="btnstyle" parent="@android:style/Widget.Button">
        <item name="android:textColor">#FFFFFF</item> 
        <item name="android:background">@drawable/my_btn</item>         
    </style>    
    <style name="liststyle" parent="@android:style/Widget.ListView">
        <item name="android:listSelector">@drawable/my_list</item>
    </style> 
    <style name="theme" parent="android:Theme.Translucent"> 
        <item name="android:windowBackground">@drawable/background</item>   
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:buttonStyle">@style/btnstyle</item>
        <item name="android:listViewStyle">@style/liststyle</item>  
    </style>
    </resources>
4

1 回答 1

8

将半透明主题应用于 AndroidManifest.xml 中的活动

<activity android:theme="@android:style/Theme.Translucent">
于 2010-09-29T12:46:14.463 回答