Hello,
Please overwrite the UpdateValue
method and add the following code in the handler class:
public override void UpdateValue(string property)
{
base.UpdateValue(property);
var tabs = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.FindViewById<FragmentContainerView>(Microsoft.Maui.Resource.Id
.navigationlayout_toptabs);
var tabLayout = tabs?.GetChildAt(0);
if (tabLayout is TabLayout layout) {
for (int i = 0; i < layout.TabCount; i++)
{
TabLayout.Tab? tab = layout.GetTabAt(i);
TabLayout.TabView? view1 = tab?.View;
for (int j = 0; j < (view1?.ChildCount ?? 0); j++)
{
var child = view1?.GetChildAt(j);
if (child is TextView tv)
{
tv.Typeface = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity.Resources.GetFont(Resource.Raw.alexbrushregular);
}
}
}
}
}
Best Regards,
Wenyan Zhang
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.