Изменение цветов TabView по умолчанию и цветов панели поиска по умолчанию - PullRequest
0 голосов
/ 01 марта 2012

хорошо, я ищу способ изменить оранжевый цвет, который появляется, когда вы нажимаете на вкладку в Android TabView и изменяете оранжевый цвет рамки вокруг панели поиска ... в любом случае, как сделать что-то подобное?

вот моя главная вкладка Просмотр

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

есть идеи ???Большое спасибо за вашу помощь !!!!

1 Ответ

0 голосов
/ 01 марта 2012

Вам нужно использовать темы. Вы можете настроить style.xml в res / values ​​и наследовать от 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>

Тогда вы можете сослаться на эту тему в своем файле манифеста. Вы можете прочитать все об этом здесь: http://developer.android.com/guide/topics/ui/themes.html

...