I use a NumberPicker in my android application of which I want to change the font, color, and font size.
I looked a bit around and found this solution here: Setting typeFace to NumberPicker
So I defined my style as follows:
<style name="NumberPickerText">
<item name="android:textSize">24sp</item>
<item name="android:textColorPrimary">@color/colorPrimary</item>
<item name="android:fontFamily">@font/poppins_light</item>
</style>
and apply it to my NumberPicker as follows:
<NumberPicker
android:id="@+id/durationPicker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
android:theme="@style/NumberPickerText"/>
When looking at my activity in the XML design window, it looks the way I want it to look like. However, when I run the application on my phone, the color and the font size are applied as intended, but the font is not "Poppins" but the default font.
Why is my font displaying as wished in the XML design window, but appears different on Runtime? And how can I make the font appear on Runtime as wished?
Thanks a lot for your help!