Android 如何更改所选选项卡的底线颜色

Android 如何更改所选选项卡的底线颜色,android,android-tabs,tabwidget,Android,Android Tabs,Tabwidget,我有一个小部件。 如何更改当前所选选项卡的底线颜色(此时默认为蓝色) 我看了看答案,但并没有说如何改变颜色 My layout/main.xml的代码是: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orien

我有一个小部件。 如何更改当前所选选项卡的底线颜色(此时默认为蓝色)

我看了看答案,但并没有说如何改变颜色

My layout/main.xml的代码是:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">

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

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="vertical" >
            <TabWidget
                android:id="@android:id/tabs"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:alpha="0.75"
                android:focusable="false"
                android:focusableInTouchMode="false"
                android:orientation="horizontal" />

            <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_weight="0" />

            <FrameLayout
                android:id="@+id/realtabcontent"

                android:layout_width="fill_parent"
                android:layout_height="0dp"
                android:layout_weight="1" />


        </LinearLayout>
    </TabHost>

</LinearLayout>


检查[this][1]线程。希望这会有所帮助。[1] :我尝试了此解决方案,但我的应用程序不起作用:(尝试教程,您只需将#004D40的颜色更改为您想要的颜色:D