Android 更改选项卡视图默认颜色和搜索栏默认颜色
好的,我正在寻找一种方法来改变当你在Android TabView中点击一个标签时出现的橙色 并更改搜索栏周围的橙色边框颜色。。。你知道怎么做那样的事吗 这是我的主要选项卡视图Android 更改选项卡视图默认颜色和搜索栏默认颜色,android,colors,tabs,tabview,searchbar,Android,Colors,Tabs,Tabview,Searchbar,好的,我正在寻找一种方法来改变当你在Android TabView中点击一个标签时出现的橙色 并更改搜索栏周围的橙色边框颜色。。。你知道怎么做那样的事吗 这是我的主要选项卡视图 <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_heig
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:background="@drawable/gradient_bg"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
我的搜索栏里有这个
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/searchText"
android:hint="@string/Search"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<ImageButton
android:id="@+id/searchButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/Search"
android:src="@drawable/search"
android:onClick="search"/>
</LinearLayout>
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:divider="#b5b5b5"
android:dividerHeight="1dp"
android:listSelector="@drawable/list_selector" />
有什么想法吗???
非常感谢你的帮助 您需要使用主题。您可以在res/values中设置style.xml,并从Holo继承并覆盖需要的属性。我这样做是为了操作栏中的选项卡:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- the theme applied to the application or activity -->
<style name="Theme.Mine" parent="android:style/Theme.Holo">
<item name="android:actionBarTabStyle">@style/MyActionBarTabStyle</item>
<item name="android:actionDropDownStyle">@style/MyDropDownNav</item>
<item name="android:selectableItemBackground">@drawable/ad_selectable_background</item>
<item name="android:popupMenuStyle">@style/MyPopupMenu</item>
<item name="android:dropDownListViewStyle">@style/MyDropDownListView</item>
<item name="android:listChoiceIndicatorMultiple">@drawable/ad_btn_check_holo_light</item>
<item name="android:listChoiceIndicatorSingle">@drawable/ad_btn_radio_holo_light</item>
</style>
<style name="MyActionBarTabStyle" >
<item name="android:background">@drawable/actionbar_tab_bg</item>
<item name="android:textColorHighlight">#FF5555</item>
<item name="android:paddingLeft">10dip</item>
<item name="android:paddingRight">10dip</item>
</style>
<style name="TableCellStyle" parent="Theme.Mine">
<item name="android:textColor">#000000</item>
<item name="android:textSize">15sp</item>
</style>
</resources>
@风格/风格
@样式/MyDropDownNav
@可绘制/可选择的背景
@样式/MyPopupMenu
@样式/MyDropDownList视图
@可抽出式/广告灯、检查灯、全息灯
@可牵引/广告btn无线电全息灯
@可绘图/操作栏\u选项卡\u背景
#FF5555
10度
10度
#000000
15便士
然后可以在清单文件中引用此主题。您可以在这里阅读所有相关内容:好的,我知道您将如何使用它,但我使用的是android 2.1。您有我可以使用的选项卡主题吗?HOLO不适用于android 2.1Plus,我只想在你选择某样东西时改变背景的颜色和恼人的橙色…我会纠正这一点,因为它适用于更高版本的android,谢谢你的帮助,我最终设法解决了它。以不同的方式