Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

How to Change Font In Tab Shell.Here My Code

$
0
0

class AndroidShell : ShellRenderer
{
public AndroidShell(Context context) : base(context)
{
}

    protected override IShellToolbarAppearanceTracker CreateToolbarAppearanceTracker()
    {
        return new MyShellToolbarAppearanceTracker(this);
    }

    protected override IShellTabLayoutAppearanceTracker CreateTabLayoutAppearanceTracker(ShellSection shellSection)
    {
        return new MyTabLayoutAppearanceTracker(this);
    }



}

internal class MyTabLayoutAppearanceTracker : IShellTabLayoutAppearanceTracker
{
    private AndroidShell _tabBarShellRenderer;
    public MyTabLayoutAppearanceTracker(AndroidShell tabBarShellRenderer)
    {
        _tabBarShellRenderer = tabBarShellRenderer;
    }

    public void SetAppearance(TabLayout tabLayout, ShellAppearance appearance)
    {
       // tabLayout.GetChildAt(1).SetPadding(10, 10, 10, 10);
        Typeface typeface = Typeface.CreateFromAsset(Android.App.Application.Context.Assets, "BBCReithSerif_W_Bd.otf");

    }

    public void ResetAppearance(TabLayout tabLayout)
    {

    }

    public void Dispose()
    {


    }
}

Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>