Question

okay i'm looking for a way to be able to change the orange colour that appears when you click on a tab in Android TabView and change the orange border colour around a search bar... anyideas how to do something like that?

thats my main tab View

<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>

and i have this for my search bar

<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" />

any ideas ??? Thanks alot for all ur help!!!!

Was it helpful?

Solution

You need to use themes. You can setup a style.xml in res/values and inherit from Holo and override the properties you need to. I did this for the Tab's in the action bar:

<?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>

Then you can reference this theme in your manifest file. You can read all about it here: http://developer.android.com/guide/topics/ui/themes.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top