【问题标题】:How to set background adapter color to #046697 (light blue) in searchview如何在搜索视图中将背景适配器颜色设置为#046697(浅蓝色)
【发布时间】:2013-10-25 19:10:56
【问题描述】:

这是我的 style.xml(我必须使用 theme.Test style )。如果我使用应用程序基础主题作为我的测试主题的样式,那么我在设置 collapseActionView 背景颜色和 searchview 背景颜色时遇到问题,那么整个活动中的所有文本视图背景颜色都会发生变化

<resources xmlns:android="http://schemas.android.com/apk/res/android">

<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
    <item name="android:actionBarStyle">@style/MyActionBar</item>

    <!-- API 14 theme customizations can go here. -->
</style>

<style name="AppTheme" parent="AppBaseTheme">
    <!-- <item name="android:background">#083044</item> -->


    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>

<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
    <item name="android:background">#083044</item>
</style>

<style name="Theme.test" parent="@style/Theme.Sherlock.Light.DarkActionBar">
    <item name="android:actionBarTabBarStyle">@style/Theme.test.tabbar.style</item>
    <item name="actionBarTabBarStyle">@style/Widget.test.ActionBar.TabBar</item>
    <item name="searchAutoCompleteTextView">@style/SearchViewStyle</item>
</style>

<style name="Theme.test.tabbar.style" parent="@style/Theme.Sherlock.Light">
    <item name="android:background">#046697</item>
    <item name="background">#046697</item>
</style>

<style name="Widget.test.ActionBar.TabBar" parent="Widget.Sherlock.Light.ActionBar.TabBar">
    <item name="android:background">#046697</item>
    <item name="background">#046697</item>
</style>

<style name="SearchViewStyle" parent="Widget.Sherlock.Light.SearchAutoCompleteTextView">
    <item name="android:textColor">@color/White</item>
    <item name="android:background">#046697</item>
    <item name="background">#046697</item>
</style>

对此的任何帮助将不胜感激:)

谢谢

【问题讨论】:

  • 将它用于特定的TextView.. 不要将这个style.xml 定义为每个TextView
  • 如何所以你能建议我的代码或任何链接.......谢谢

标签: android styles


【解决方案1】:

我认为你需要把你的财产

&lt;color name="white"&gt;#FFFFFF&lt;/color&gt;

style.xml

android:background="@color/white"&gt;

AndroidManifest.xml.

【讨论】:

    猜你喜欢
    • 2021-08-18
    • 1970-01-01
    • 1970-01-01
    • 2011-01-11
    • 2021-10-28
    • 1970-01-01
    • 2017-09-11
    • 2011-11-18
    • 1970-01-01
    相关资源
    最近更新 更多