I'm using Android Studio and have a SwitchCompat widget in my main activity. The default fontfamily it had was sans-serif-medium and I changed it to quicksand_light. I also have some TextViews with each of their fontfamily's set to quicksand_light. On the design tab of the xml file for my activity it shows the SwitchCompat having the quicksand_light fontfamily just as the TextViews, but when I run it on my phone or on an emulator the SwitchCompat's fontfamily is sans-serif-medium. Is there something extra I need to do to change the fontfamily or is this a bug or is this just me?
SwitchCompat fontfamily won't change
1k Views Asked by K.R. At
2
I haven't dived deep into why it's not working correctly when defining the
fontFamilyattribute in xml, but IT WORKS if you set the typeface programmatically.Here's an example using data-binding.
Add the following data-binding adapter:
and use it in your layout: