多色彩的动作栏

时间:2015-01-31 05:20:49

标签: android

<style name="Theme.MyAppTheme" parent="android:style/Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/Theme.MyAppTheme.ActionBar</item>
    <item name="android:popupMenuStyle">@style/popupMenuStyle</item>
    <item name="android:actionBarWidgetTheme">@style/Theme.MyTheme.Widget</item>
    <item name="android:actionBarItemBackground">@null</item>
    <item name="android:listPreferredItemHeightSmall">45dp</item>
    <item name="android:itemTextAppearance">@style/PopUpText</item>
</style>

<style name="popupMenuStyle" parent="@android:style/Widget.PopupMenu">
    <item name="android:popupBackground">@android:color/white</item>
</style>

<style name="PopUpText" parent="@android:style/TextAppearance.Widget.TextView.PopupMenu">
    <item name="android:textColor">@color/tab_blue</item>
</style>

<style name="Theme.MyAppTheme.ActionBar" parent="android:style/Widget.Holo.Light.ActionBar">
    <item name="android:background">#0675bc</item>
    <item name="android:titleTextStyle">@style/Theme.MyAppTheme.ActionBar.TitleTextStyle</item>
    <item name="android:spinnersShown">@style/Spinner</item>
</style>

<style name="Theme.MyAppTheme.ActionBar.TitleTextStyle" parent="android:style/TextAppearance.Holo.Widget.ActionBar.Title">
    <item name="android:textColor">#FFF</item>
</style>

<style name="MySpinnerLook" parent="@android:TextAppearance.Widget.TextView.SpinnerItem">
    <item name="android:textSize">20sp</item>
</style>

<style name="Spinner" parent="@android:TextAppearance.Widget.TextView.SpinnerItem">
    <item name="android:textSize">20sp</item>
</style>

<style name="Theme.MyTheme.Widget" parent="@android:style/Theme.Holo.Light">
    <item name="android:textColor">#0675bc</item>
    <item name="android:textAppearance">@style/EditTextStyle</item>
    <item name="android:background">@android:color/white</item>
</style>

<style name="EditTextStyle" parent="@android:style/TextAppearance.Widget.EditText">
    <item name="android:textColor">#0675bc</item>
    <item name="android:background">#0675bc</item>

</style>

</resources>

有没有办法创建像

这样的多色动作栏
  1. 操作栏编辑文本背景颜色 - 黄色
  2. 操作栏编辑文字提示文字color-green
  3. 操作栏背景颜色-red等 我正在使用上面的代码我成功更改了操作栏背景颜色但问题我需要完全自定义操作栏。假设有动作栏 1.edit文本 2.搜索视图 3.下拉列表 我需要以上三种应该有三种颜色才有可能

0 个答案:

没有答案