0

我想让 actionbardropdown 和溢出菜单透明我该怎么做?

我努力了

   <style name="Theme.MyTheme" parent="@style/Theme.Sherlock.Light">
        <item name="android:actionBarStyle">@style/myactionbar</item>
        <item name="windowActionBarOverlay">true</item>
        <item name="android:windowActionBarOverlay">true</item>
        <item name="actionDropDownStyle">@style/dropdown</item>
        <item name="popupMenuStyle">@style/popupmenucolor</item>
        <item name="actionBarStyle">@style/myactionbar</item>
        <item name="dropDownListViewStyle">@style/dropdownlistview</item>
    </style>

    <style name="myactionbar" parent="@style/Widget.Sherlock.Light.ActionBar">
        <item name="android:background">@android:color/transparent</item>
        <item name="background">@android:color/transparent</item>
        <item name="android:actionBarTabStyle">@style/ActionBarTabStyle</item>
        <item name="actionBarTabStyle">@style/ActionBarTabStyle</item>
    </style>

    <style name="ActionBarTabStyle" parent="@style/Widget.Sherlock.ActionBar.TabView">
        <item name="background">@android:color/transparent</item>
        <item name="android:background">@android:color/transparent</item>
    </style> 

    <style name="dropdown" parent="@style/Widget.Sherlock.Light.Spinner.DropDown.ActionBar">
        <item name="android:background">@drawable/transparent_background</item>
        <item name="android:popupBackground">@drawable/dropdown</item>
        <item name="android:dropDownSelector">@drawable/selectable_background_colors</item>
    </style>

    <style name="dropdownlistview" parent="@style/Widget.Sherlock.Light.ListView.DropDown">
        <item name="android:listSelector">@drawable/dropdown</item>
    </style>

    <style name="popupmenucolor" parent="@style/Widget.Sherlock.Light.ListPopupWindow">
        <item name="android:popupBackground">@drawable/dropdown</item>
    </style>

这里@drawable/dropdown 是一个 9 块半透明图像,不透明度为 30%

但它不会使下拉列表透明。我怎样才能得到这个?

谢谢

4

0 回答 0