How can I increase the font size of the "Tabbed Page" tab?

akiasakuraakiasakura USMember ✭✭

I was able to display the icon on the tab of "Tabbed Page" using "Font Awesome".
However, I can not change the font size.

First, look at the source you wrote to display the icon.
`

[assembly: ExportRenderer(typeof(TabbedPage), typeof(ContentPageRenderers))]
namespace Social.Droid.Renderers
{
    class ContentPageRenderers : TabbedPageRenderer, TabLayout.IOnTabSelectedListener
    {
        protected override void OnElementChanged(ElementChangedEventArgs<TabbedPage> e)
        {
            base.OnElementChanged(e);

            var fieldInfo = typeof(TabbedPageRenderer).GetField("_tabLayout", BindingFlags.Instance | BindingFlags.NonPublic);
            var tabs = (TabLayout)fieldInfo.GetValue(this);

            changeTabsFont(tabs);
        }
        private void changeTabsFont(TabLayout tabs)
        {

            ViewGroup vg = (ViewGroup)tabs.GetChildAt(0);
            int tabsCount = vg.ChildCount;
            for (int j = 0; j < tabsCount; j++)
            {
                ViewGroup vgTab = (ViewGroup)vg.GetChildAt(j);
                int tabChildsCount = vgTab.ChildCount;
                for (int i = 0; i < tabChildsCount; i++)
                {
                    var tabViewChild = vgTab.GetChildAt(i);
                    if (tabViewChild is TextView)
                    {
                        Typeface tf = Typeface.CreateFromAsset(Forms.Context.Assets, "Fonts/FontAwesome.otf");
                        var child = (TextView)tabViewChild;
                        child.Typeface = tf;
                        //child.SetTextSize(ComplexUnitType.Px, 50);
                    }
                }
            }
        }
    }
}

`
Is it wrong with the code commented out with this source?

help me.

Sign In or Register to comment.