Hello,
Please create a font
folder in the Platforms/Android/Resources
folder.
Then copy your font files in font
folder. Please change your font file's name with Lowercase characters and _ like alexbrush_regular.ttf
, make sure this font's build action is AndroidResource
Then, you can set the font with textView.SetTypeface(Platform.CurrentActivity.Resources.GetFont(Resource.Font.alexbrush_regular),TypefaceStyle.Normal);
in the custom renderer like following code.
public void SetAppearance(TabLayout tabLayout, ShellAppearance appearance)
{
for (int i = 0; i < tabLayout.TabCount; i++)
{
var tab = tabLayout.GetTabAt(i);
var tabView = tab.View as LinearLayout;
if (tabView is null)
return;
var textView = tabView?.GetChildAt(1) as TextView;
textView.SetTypeface(Platform.CurrentActivity.Resources.GetFont(Resource.Font.alexbrush_regular),TypefaceStyle.Normal);
...
}
}
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.