astuetz / PagerSlidingTabStrip

An interactive indicator to navigate between the different pages of a ViewPager
139 stars 44 forks source link

How to use IconTitleProvider #195

Open dieuhd opened 9 years ago

dieuhd commented 9 years ago

I want to use IconTitleProvider but not working Please help me

ghost commented 9 years ago

Hi in your adapter you must override getPageIconResId, below an example.

private int[] ICONS; //This will hold your icons resource ids

public YourAdapter(FragmentManager fm, Context context) { super(fm); this.context = context; TITLES = new String[]{context.getResources().getString(R.string.string_feed), ICONS = new int[]{R.mipmap.areousrceid}; }

@Override public int getPageIconResId(int i) { return ICONS[i]; }

Have in mind that this will substitute any string based titles to the icon ones.

Ridermansb commented 9 years ago

The current version com.astuetz:pagerslidingtabstrip:1.0.1 has no getPageIconResId

even PagerSlidingTabStrip.IconTabProvider