How can I remove divider lines in number picker, I tried setShowDivider to none(seems none doesn't exist) through xml and code noting worked
picker.setShowDividers(LinearLayout.SHOW_DIVIDER_NONE);
XML:
android:showDividers="none"
Set Theme for Numberpicker
<NumberPicker
...
android:theme="@style/DefaultNumberPickerTheme" />
style.xml
<style name="DefaultNumberPickerTheme" parent="AppTheme">
<item name="colorControlNormal">@color/transparent</item>
</style>
OR
private void changeDividerColor(NumberPicker picker, int color) {
java.lang.reflect.Field[] pickerFields = NumberPicker.class.getDeclaredFields();
for (java.lang.reflect.Field pf : pickerFields) {
if (pf.getName().equals("mSelectionDivider")) {
pf.setAccessible(true);
try {
ColorDrawable colorDrawable = new ColorDrawable(color);
pf.set(picker, colorDrawable);
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (Resources.NotFoundException e) {
e.printStackTrace();
}
catch (IllegalAccessException e) {
e.printStackTrace();
}
break;
}
}
}
And Set it as
changeDividerColor(yournumberpicker, Color.parseColor("#00ffffff"));
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