2010-12-06 30 views

答えて

0

TabHost.TabSpec.setIndicator(android.view.View view)あなたのニーズに合わせてTextViewが設定されています(カラー化されています)。

しかし、あなたの投稿をもう一度読み直しました。タブのラベルについて話しているうちに、タブのコンテンツの色を変更する方法を意味しています。この場合は、この回答を無視してください。

UPDATE

あなたのレイアウトXMLで行うことが最も快適である:

<?xml version="1.0" encoding="utf-8"?> 
<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:layout_width="fill_parent" 
      android:layout_height="fill_parent"> 
      <TextView 
       android:id="@+id/textview1" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:text="this is a tab - RED" 
       android:textColor="#FF0000" /> 
      <TextView 
       android:id="@+id/textview2" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:text="this is another tab - GREEN" 
       android:textColor="#00FF00" /> 
      <TextView 
       android:id="@+id/textview3" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:text="this is a third tab - BLUE" 
       android:textColor="#0000FF" /> 
     </FrameLayout> 
    </LinearLayout> 
</TabHost> 
0

タブのテキストの色を変更するには、タブのタイトルとして設定されており、あなたはこのようにそれを変更することができますビューすなわちTextViewに取得する必要があります。このことができます

​​

希望を....