0

I searched , but answers didn't work.Because my titles are not TextView. my activity_main is like this:

   <TabHost
    android:id="@+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"
            android:background="@color/colorPrimary" />

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

            <RelativeLayout
                android:id="@+id/tab1"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:contentDescription="HOME">

and TabHost setup in MainActivity is this:

        TabHosts tabhost;
    @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    tabHost = (TabHost) findViewById(R.id.tabHost);
    tabHost.setup();

    TabSpec spec1 = tabHost.newTabSpec("TAB 1");
    spec1.setContent(R.id.tab1);
    spec1.setIndicator("Home");

    tabHost.addTab(spec1);

So I can change the color with styles in AppTheme but it will change all of text colors to white.how I can change just tabhost title color?

Mr.Mr
  • 23
  • 6

0 Answers0