我想问一下,是否可以在SlidingTablayout中更改选项卡指示器的颜色?我必须使用developer.
android.com的SlidingTabsColors吗?我只是想换另一种颜色而不是默认的蓝色(我认为)颜色.请指教.谢谢!!!
解决方法
只是为了让它更清晰.
SlidingTabLayout tabs = (SlidingTabLayout) findViewById(R.id.sliding_tabs); //referring the layout in xml file tabs.setViewPager(viewpager); //setting the viewpager //setting indicator and divider color tabs.setCustomTabColorizer(new SlidingTabLayout.TabColorizer() { @Override public int getIndicatorColor(int position) { return getResources().getColor(R.color.white); //define any color in xml resources and set it here,I have used white } @Override public int getDividerColor(int position) { return getResources().getColor(R.color.white); } });