How to increase font size NumberPicker Android 6.0?

Greg Ellis picture Greg Ellis · Nov 14, 2015 · Viewed 23.1k times · Source

I have noticed that the NumberPicker in Android 6.0 has a very very small font size compared to previous versions. The font size is so small I can only assume it's a bug...

I can't find a way to increase the font size of the NumberPicker. There is the ScaleX and ScaleY factors, but obviously changing these will make the NumberPicker appear too big on older Android versions.

I could set the ScaleX and ScaleY factors programatically based on Android version, but this doesn't seem like a smart solution since one has to imagine that Google will eventually increase the font size of the NumberPicker because it's almost unreadable now.

Anyone out there have any ideas on how to handle this issue?

Edit: I also tried to compile against an older version of the Android SDK in Android Studio hoping that the NumberPicker appearance would revert back to the previous style, but it doesn't matter what version of the SDK I compile against it keeps the new Android 6.0 NumberPicker style.

Difference in NumberPicker font between Android versions

Answer

Jakub S. picture Jakub S. · Jul 17, 2017

Based on John Starbird answer.

You add style.

<style name="NumberPickerText">
    <item name="android:textSize">22sp</item>
</style>

Add style to your Number Picker in XML.

android:theme="@style/NumberPickerText"