Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

How to set fontFamily for the entire Xamarin.Android application in a single place?

I want to set the fontFamily of the Toolbar's texts, Buttons, TextViews and for all the text of the Xamarin.Android application in general. How do I do that in a single place? I tried putting the following in the Base application theme in styles.xml :

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    .....
    <item name="fontFamily">@drawable/Exo2_ExtraBold</item>
    .....
</style>

But it only changed the fontFamily of the MainActivity, I guess it's because only that activity has Theme = "@style/AppTheme" attribute above it. If I put that attribute above the rest of the activities I guess it will also work, but isn't there an easier way to achieve all the app to have one fontFamily, setting it in a single place of the application? And also I put the .otf file in the drawables folder, I tried putting it in the font folder I created manually but it gave me an error when trying to rebuild the solution. So I'd like to know how can I fix that also, to put the .oft in the correct folder.

Best Answer

Answers

  • AnonymousUserAnonymousUser USMember ✭✭✭
    edited January 4

    The fontFamily doesn't apply to the toolbar title. What may be the cause and how to fix it?

Sign In or Register to comment.