Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/195.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android操作栏导航微调器文本颜色_Android_Android Actionbar_Android Theme - Fatal编程技术网

Android操作栏导航微调器文本颜色

Android操作栏导航微调器文本颜色,android,android-actionbar,android-theme,Android,Android Actionbar,Android Theme,我可以更改导航微调器的背景: <style name="MyTheme" parent="android:style/Theme.Light"> <item name="android:actionBarStyle">@style/MyActionBar</item> <item name="android:actionDropDownStyle">@style/MyDropDownNav</item>

我可以更改导航微调器的背景:

  <style name="MyTheme" parent="android:style/Theme.Light">
        <item name="android:actionBarStyle">@style/MyActionBar</item>
        <item name="android:actionDropDownStyle">@style/MyDropDownNav</item>
    </style>

  <style name="MyDropDownNav" parent="android:style/Widget.Spinner">
        <item name="android:background">@drawable/spinner_white</item>
        <item name="android:textColor">@color/red</item>
    </style>

@样式/MyActionBar
@样式/MyDropDownNav
@可拉拔/旋转装置(白色)
@颜色/红色
然而,文本颜色没有改变。我还尝试了其他方法来更改文本颜色:

 <style name="MyActionBar" parent="@android:style/Widget.Holo.ActionBar">
        <item name="android:background">?color_actionbar</item>
        <item name="android:titleTextStyle">@style/myTheme.ActionBar.Text</item>
    </style>

  <style name="myTheme.ActionBar.Text" parent="@android:style/TextAppearance">
        <item name="android:textColor">@color/violet</item>
    </style>

?彩色操作栏
@style/mysteme.ActionBar.Text
@颜色/紫色

还有别的想法吗

我一直在寻找相同的答案,但什么也没找到,所以我尝试了这个解决方案。至少我为自己工作

在主题文件中,可以设置spinnerDropdownItemStyle的样式:

<style name="YourTheme" parent="YourParentTheme">
    <item name="android:spinnerDropDownItemStyle">@style/YourCustomDropDownItemStyle</item>
</style>

@style/YourCustomDropDownItemStyle
现在,为您的样式设置文本外观:

<style name="YourCustomDropDownItemStyle" parent="@android:style/Widget.Holo.DropDownItem.Spinner">
    <item name="android:textAppearance">@style/YourCustomDropDownItemTextStyle</item>
</style>

@style/YourCustomDropDownItemTextStyle
在自定义文本外观中,您可以设置文本详细信息:

<style name="YourCustomDropDownItemTextStyle" parent="@android:style/Widget">
    <item name="android:textColor">@color/white</item>
    <!-- Here you can set the color and other text attributes -->
</style>

@颜色/白色

希望这有帮助

未找到与给定名称匹配的资源'Widget@Mike如果您使用的是Sherlok Action Bar,请使用
parent=“TextAppearance.Sherlock.Widget.ActionBar.Title”
,如果不是,应该是类似的。他忘了在
Widget
前面添加
android:
,您能详细说明一下如何使用它吗?那么这个父主题呢?文本的颜色对我来说不会改变。