0

Hello guys I am working on an android project. I want to change the strip color of tab widget and also change the size of tab text. Please tell me solution how can I do this? enter image description here

This is code:

<?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="match_parent"
    android:layout_height="fill_parent"
    android:background="@android:color/holo_blue_dark">

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

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="wrap_content"
            android:layout_height="50dp"
            android:layout_marginLeft="30dp"
            android:layout_marginTop="30dp"
            android:elevation="0dp"
            android:showDividers="none"
            android:tabStripEnabled="false" />

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="match_parent"
            android:layout_height="fill_parent" />
    </LinearLayout>
</TabHost>
Dhruv
  • 1,801
  • 1
  • 15
  • 27
Noman Malik
  • 103
  • 3
  • 5
  • 18
  • You can check this [http://stackoverflow.com/a/15750561/4049612](http://stackoverflow.com/a/15750561/4049612) to change the tab bottom color – Krishna May 06 '16 at 07:27

1 Answers1

0
<style name="MyTabTextAppearance" parent="TextAppearance.AppCompat.Button">
    <item name="android:textSize">18sp</item>
    <item name="android:textColor">@android:color/white</item>
    <item name="textAllCaps">true</item>
<com.google.android.material.tabs.TabLayout
        android:id="@+id/tab_layout"
        android:layout_width="match_parent"
        android:layout_height="@dimen/welcome_menu_icon_height_10"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="@dimen/margin_15"
        android:background="@android:color/transparent"
        android:nestedScrollingEnabled="true"
        android:scrollbarThumbVertical="@color/white"
        android:textAlignment="center"
        app:tabGravity="center"
        app:tabIndicatorAnimationDuration="1"
        app:tabIndicatorColor="@color/white"
        app:tabMode="scrollable"
        app:tabSelectedTextColor="@color/white"
        app:tabTextAppearance="@style/MyTabTextAppearance"
        app:tabTextColor="@color/white" />

 tabLayout.addTab(tabLayout.newTab().setText(R.string.casa))
        tabLayout.addTab(tabLayout.newTab().setText(R.string.fdr_dps))
        tabLayout.addTab(tabLayout.newTab().setText(R.string.loan))