239 Android SlidingTabLayout Part 2 |
Why Stack Overflow recommends it
Stack Overflow users link it when answering questions about SlidingTabLayout customisation, such as tab indicator colours, equal tab spacing and icon tabs.
Recommended by 2 people across 2 different months, 2015 to 2016.
What it is
A 13-minute Android tutorial from the slidenerd channel, part 2 of a series on Google's SlidingTabLayout. It shows how to put icons in the tabs using a custom tab layout and ImageSpan, distribute tabs evenly, and set a custom indicator colour per tab.
What people said
Recommends Jaydeep · 2015-07 · Stack Overflow · on “Android Swipe Tab customize the Tab Indicator color”
you can change tab Indicator colour using this code : tabs = setCustomTabColorizer(new SlidingTabLayout.TabColorizer(){ @override public int getIndicatorColor(int position) return getResources().getColor(R.color.colorAccent); } )}; check this sample tutorial : [this video]
Recommends Princeps Polycap · 2016-02 · Stack Overflow · on “How to split the tab view at equal space in the Action Bar in android?”
You should try this in onCreate slidingTabLayout.setDistributeEvenly(true); [this video] I also linked you to a slidenerd video where he would explain more about it
Recommends Princeps Polycap · 2016-02 · Stack Overflow · on “FragmentTabHost: How to share equal space for tab”
Try this in onCreate slidingTabLayout.setDistributeEvenly(true); [this video] I also linked you to a slidenerd video where he would explain more
Cites Elvis King · 2015-06 · Stack Overflow · on “Android - highlight icon with SlidingTabLayout”
Currently I'm trying to implement the SlidingTab with icon as tabtitle, then the icon should be highlighted when the corresponding tab is selected. I use Google's SlidingTabLayout in following tutorial, and have made the icon instead of the tabtitle as well. [this video] I know where I can get the current tab position by implementing OnPageChangeListener, but I don't what should I add in public void onPageSelected(int position) {} here is my current status and code, please kindly advise, it will be appreciate if you keep the instruction as detail as possible, since I am a very beginner as a android developer. thanks MainActivity.java public class MainActivity extends AppCompatActivity implements