I changed the background color in PagerTabStrip, but the tabs titles have a white background
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<android.support.v4.view.PagerTabStrip
android:id="@+id/pager_tab_strip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:background="#c9c9c9"
android:padding="4dp"
android:textColor="#000000"
/>
where do I change it?
Create a resource file if it does not exist (for colors) at res/values/colors.xml with a color having the value you want.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="tabstrip_bg">#ff6d9850</color>
</resources>
In your layout file (holding respective ViewPager and TabStrip) modify the android:background parameter that refers to above color, as shown below.
<android.support.v4.view.ViewPager
android:id="@+id/pager_charts"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<android.support.v4.view.PagerTabStrip
android:id="@+id/pager_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:background="@color/tabstrip_bg" />
</android.support.v4.view.ViewPager>
Try inserting this XML code:
android:textColor="#<COLOR-CODE>"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With