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.
Use picker. getValue() to get the current value of the picker.
In the source for NumberPicker, the text size is set based on the EditText child at initialization. If you try to change it later, the EditText field will get big, but all other numbers drawn directly by the widget will still be small.
Click Ctrl + Shift + A. A new box will appear, search font there then you can see a lot of options then click on increase font size. It will increase the font size of the editor by some pixels. You can repeat the same process to decrease the font size. Want a more fast-paced & competitive environment to learn the fundamentals of Android?
There are two areas you can tweak your font size, but it’s the first – under “Display” – that you want to choose. The Accessibility option is a bit more powerful and probably more than you’ll need. Tap on “Font size and style” and it’ll jump you straight to the exact setting you need: Oops.
This example demonstrates how do I change the spinner textSize and textColor in android. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main.xml. Step 3 − Add the following code to src/MainActivity.java
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With