I am using numberpicker widget for showing a spinner wheel for string values. I want to show the complete text value in an item window in numberpicker. how can i achieve it? I have multiple number picker widgets aligned horizontally. I can view some of the text of an item but not all of it. Please help!
Show complete text value using numberpicker for strings in android
3.9k views Asked by S.Khan At
2
There are 2 answers
1
On
strings.xml
<string-array name="numberPicker">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
</string-array>
fill NumberPicker
binding.numberPicker.setMaxValue(getResources().getStringArray(R.array.numberPicker).length);
binding.numberPicker.setMinValue(0);
binding.numberPicker.getResources().getStringArray(R.array.numberPicker);
binding.numberPicker.setWrapSelectorWheel(true);
You can just use the NumberPicker with an array of string
xml:
code: