Android TabHost文字颜色

时间:2017-02-16 19:00:29

标签: java android android-tabhost fragment-tab-host

如何更改tabhost中选项卡的文本颜色。似乎有点尴尬。提前致谢。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/LinearLayout1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin"
        tools:context="com.example.tabdemo.MainActivity" 
        android:background="#00496b"
        android:textColor="#FFFFFF">


        <TabHost
            android:id="@android:id/tabhost"
            android:layout_width="match_parent"
            android:layout_height="match_parent" 

            >

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                 >

                <TabWidget
                    android:id="@android:id/tabs"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"   >

                </TabWidget>

                <FrameLayout
                    android:id="@android:id/tabcontent"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" >


                </FrameLayout>
            </LinearLayout>
        </TabHost>

    </LinearLayout>

宁愿通过XML反对程序化 - 但如果没有别的办法。

0 个答案:

没有答案