Custom Font Android ActionBar only in one ContentPage


I was wondering if is possible to change the ActionBar font only in one ContentPage.

With CalligraphyLibrary I was able to set a global custom font for my app, which works for actionBar too.

But in a particular case, I need that one ContentPage use a different CustomFont.

I tried this code:

     var st = new SpannableString(this.Title);
     st.SetSpan(new TypefaceSpan(this, "CustomFont.otf"), 0, st.Length(), SpanTypes.ExclusiveExclusive);

    var actionBar = ((Activity)this.Context).ActionBar;
    actionBar.TitleFormatted = st;

Just for that page. But did not work.

I also tried CustomRenderers...But without luck

Any help on this?

Best Answer


Sign In or Register to comment.