简体   繁体   中英

Android: how to change title bar color of popup using xml styles

I have the following stylesheet, but the popup title is still white. How do I change this using xml styling?

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Theme.Splash" parent="android:Theme">
        <item name="android:windowBackground">@drawable/splash</item>
        <item name="android:windowNoTitle">true</item>
    </style>

    <style name="YellowWarning" parent="android:Theme">
        <item name="android:textColor">@color/yellow</item>
    </style>

    <style name="FloodSearchTheme" parent="@android:style/Theme.Holo.Light">
        <item name="android:actionBarStyle">@style/FloodSearchTheme.ActionBarStyle</item>
        <item name="android:textColor">#ffffff</item>
        <item name="android:editTextStyle">@style/FloodSearchTheme.EditTextStyle</item>
        <item name="android:itemBackground">#333333</item>
    </style>

    <style name="FloodSearchTheme.ActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar">
        <item name="android:titleTextStyle">@style/FloodSearchTheme.ActionBar.TitleTextStyle</item>
        <item name="android:background">#333333</item>
    </style>

    <style name="FloodSearchTheme.ActionBar.TitleTextStyle" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
        <item name="android:textColor">#ffffff</item>
    </style>

    <style name="FloodSearchTheme.EditTextStyle" parent="@android:style/Widget.EditText">
        <item name="android:background">#ffffff</item>
        <item name="android:textColor">#000000</item>
        <item name="android:padding">10dp</item>
    </style>
</resources>

在此处输入图片说明

Here is the code...

    public override void OnCreateContextMenu(IContextMenu menu, View v, IContextMenuContextMenuInfo menuInfo)
    {
        base.OnCreateContextMenu(menu, v, menuInfo);
        if (v.Id != Resource.Id.historyListView) return;

        menu.SetHeaderTitle("Options");  commenting this out bc i can't figure out how to make the title bar white, doesnt seem to be a style associated and google searches have turned up nothing
        menu.Add("Edit");
        menu.Add("Delete");
        menu.Add("Share via Email");
        menu.Add("Share via Text");
        menu.Add("Get Full Report");
    }

Have you tried setting android:windowTitleStyle? Here 's is a similar question

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM