android - Do some styles disable ImageSpan in a TextView -
i have app adds small graphic next title of tab in action bar using custom view , setting imagespan text, see below.
private void notifytab ( int state ) { console.writeline("notifying tab " + state ); var tab = supportactionbar.gettabat( state ).customview textview; string title; if ( artist == state ) { title = getstring( resource.string.menu_artists ); } else { title = getstring( resource.string.menu_friends ); } spannablestring text = new spannablestring( " " + title ); imagespan icon = new imagespan( this, resource.drawable.ico_indicator, spanalign.baseline ); text.setspan( icon, 0, 1, spantypes.inclusiveinclusive ); tab.settext( text, textview.buffertype.spannable ); } this code working fine until applied same styling tab actionbar tabs use widget.sherlock.actionbar.tabtext did imagespan stopped working.
does know attribute causes , if there workaround? i'm wondering if it's caused forced use of caps, or serif font.
solved, turns out
<item name="android:textallcaps">true</item> is guilty party, when removed imagespan shows up. simple workaround make string resources capitalised , problem gone.
Comments
Post a Comment