I\'m implementing a SlidingTabLayout in my android application. What my query is that I\'d like to implement icons in my Sliding Tabs instead of texts for navigation. I sear
Ok.. there are many ways of implementing this change. This is the most quick and dirty one, just for the idea..
Substitue the method SlidingTabLayout.populateTabStrip() for this..
private void populateTabStrip() {
final OnClickListener tabClickListener = new TabClickListener();
View tabView = LayoutInflater.from(getContext()).inflate(R.layout.tab_notif_icon_only, mTabStrip, false);
tabView.setOnClickListener(tabClickListener);
mTabStrip.addView(tabView);
tabView = LayoutInflater.from(getContext()).inflate(R.layout.tab_weather_icon_only, mTabStrip, false);
tabView.setOnClickListener(tabClickListener);
mTabStrip.addView(tabView);
tabView = LayoutInflater.from(getContext()).inflate(R.layout.tab_calendar_icon_only, mTabStrip, false);
tabView.setOnClickListener(tabClickListener);
mTabStrip.addView(tabView);
Create each layout this way LinearLayout > ImageView elements, src pointing to icon..