I'm using PagerSlidingTabStrip library .
I don't know how can I change tabs background color . I tried to change it from xml like this :
<android.support.v4.view.PagerTitleStrip
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/title"
android:paddingTop="4dp"
android:layout_gravity="top"
android:background="#222222"
android:paddingBottom="4dp"
>
</android.support.v4.view.PagerTitleStrip>
but it didn't work .
this is the mainActivity :
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
pager = (ViewPager) findViewById(R.id.pager);
adapter = new MyPagerAdapter(getSupportFragmentManager());
pager.setAdapter(adapter);
final int pageMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 4, getResources().getDisplayMetrics());
pager.setPageMargin(pageMargin);
tabs.setViewPager(pager);
tabs.setTabBackground(Color.RED);
changeColor(currentColor);
}
Could you help me ?
thanks you