Set line color in component

25 views Asked by At

How to set NumberPicker horizontal lines to white in layout xml?

enter image description here

1

There are 1 answers

0
Pawan Harariya On BEST ANSWER

Create a custom theme for the NumberPicker.

Create a styles.xml file in res/values folder, if it doesn't exist and define a theme for number picker. Define colorControlNormal attribute to required color.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="NumberPickerTheme" parent="Theme.AppCompat">
        <item name="android:colorControlNormal">#FF0000</item> 
    </style>
</resources>

Apply the theme to your NumberPicker.

<NumberPicker
        android:theme="@style/NumberPickerTheme"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />