![]() Or you can set android:textFontWeight="500" on the TextView directly, which defeats the purpose of having reusable custom styles for TextViews, since you'll be applying your custom style + an extra textFontWeight on every. The only thing that seems to work is explicitly setting android:textStyle="bold" on the TextView directly, which doesn't feel right and doesn't solve the issue if you have multiple "bolder" weights. I have tried explicitly setting the android:fontFamily and fontFamily items in my style to the specific medium font And this does NOT work. Applying the font weight can be done programmatically (as noted in this Google Issue: ) but this is not ideal when you have hundreds of TextViews in layout resources.įor instance, I have a font set at my app theme level: then I have custom styles that I apply to the textAppearance attribute on my TextViews: In this example, setting the 500 in my custom style does not apply the medium weight font to my TextView. Note that the whole UI is affected and both IDEs seem to use the same font, not just the editors. ![]() However, Android Studio renders lighter fonts and I find them easier on my eyes (see below). ![]() give text color and font size in android string. android java textview weight programmatically. android studio lower case letters on a button. Note: I am looking for a way to apply font weight in a reusable style via XML. I use IDEA and Android Studio on a daily basis and both editors on both IDEs use the same font settings, Menlo, 12pt. Answers related to change font weight in android studio programmatically. I'm talking about fonts that come as "Thin", "Regular", "Medium", "Semibold".
0 Comments
Leave a Reply. |