Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase font size NumberPicker Android 6.0? [duplicate]

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

like image 998
Greg Ellis Avatar asked Nov 14 '15 17:11

Greg Ellis


People also ask

How can I get value from number picker?

Use picker. getValue() to get the current value of the picker.

Why is the text size in numberpicker so small?

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.

How do I increase the font size of the editor?

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?

How do I change the font size on my Android phone?

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.

How to change the spinner textsize and textcolor in Android?

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


1 Answers

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"
like image 94
Jakub S. Avatar answered Sep 30 '22 05:09

Jakub S.