カスタムビューを使用してテキストに設定することで、アクションバーのタブのタイトルの横に小さなグラフィックを追加するアプリがありImageSpan
ます。以下を参照してください。
private void NotifyTab ( int state )
{
Console.WriteLine("Notifying tab " + state );
var tab = SupportActionBar.GetTabAt( state ).CustomView as 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 );
}
このコードは、アクションバータブが使用するのと同じスタイルをタブに適用するとWidget.Sherlock.ActionBar.TabText
すぐに機能しなくなるまで、正常に機能ImageSpan
していました。
これを引き起こす属性と、回避策があるかどうかは誰にもわかりますか? 強制的にすべて大文字を使用したことが原因なのか、それともセリフ フォントが原因なのか疑問に思っています。