JoanZapata / android-iconify

Android integration of multiple icon providers such as FontAwesome, Entypo, Typicons,...
http://joanzapata.com/android-iconify
Other
3.93k stars 529 forks source link

Not working on TabLayout #197

Open neutt22 opened 7 years ago

neutt22 commented 7 years ago

Here's my current code:

` @Override public CharSequence getPageTitle(int position) { Drawable drawable = new IconDrawable(context, FontAwesomeIcons.fa_android);

    drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());

    SpannableString spannableString = new SpannableString(" " + TAB_TITLES[position]);
    ImageSpan imageSpan = new ImageSpan(drawable, ImageSpan.ALIGN_BOTTOM);

    spannableString.setSpan(imageSpan, 0, 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    return spannableString;

}`

Only text are being shown. I'm using support TabLayout.