TabHostはViewGroupを継承しているので、子Viewを総なめして、タブのTextViewを直接操作するという方法はあります。
これですと文字色に限らず、背景色等も自由にカスタマイズできます。
ただ、コードの書き方によってはOSバージョン依存になってしまいます。
とりあえず文字色だけ変更するのであれば、setTextした内容の文字列を持っているTextViewを探す、という方式を採るのが良いと思います。
もう少しソフトな方法ですと、setIndicatorで独自のViewを組み込むというものです。
例えば、
lang
1<?xml version="1.0" encoding="utf-8"?>
2<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:layout_width="match_parent"
4 android:layout_height="match_parent"
5 android:orientation="vertical">
6
7 <TextView
8 android:id="@+id/text"
9 android:layout_width="match_parent"
10 android:layout_height="wrap_content"
11 android:layout_gravity="center_vertical|center_horizontal"
12 android:textColor="色指定"/>
13</LinearLayout>
のようなレイアウトを用意します。
これを、
lang
1TabHost.TabSpec tabSpec = tabHost.newTabSpec("TabTag");
2LinearLayout tabLayout = (LinearLayout) inflater.inflate(R.layout.tab, null);
3TextView tabTextView = (TextView) tabLayout.findViewById(R.id.text);
4tabTextView.setText("タブ文字列");
5tabSpec.setIndicator(tabLayout);
のようにすれば、文字色以外も文字表示部分をカスタマイズできます。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。