you can change the default background of TabPageIndicator in two ways
1. you can change the background in XML
<com.viewpagerindicator.TabPageIndicator android:id="@+id/container" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#0c445c" />
2. Replace the constructor in the TabPageIndicator.java class in the viewpager library
public TabPageIndicator(Context context, AttributeSet attrs) { super(context, attrs); setHorizontalScrollBarEnabled(false); mTabLayout = new IcsLinearLayout(context, R.attr.vpiTabPageIndicatorStyle); mTabLayout.setBackgroundColor(Color.parseColor("#0c445c")); addView(mTabLayout, new ViewGroup.LayoutParams(WRAP_CONTENT, MATCH_PARENT)); }
Hope this help
Mohit rakhra
source share