changing the color of number picker items

367 views Asked by At

How to change the color of number picker items(numbers, texts)?

I tried changing color with styles.xml file but it didn't work

styles.xml :

<?xml version="1.0" encoding="utf-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android">
 <style name="NumberPickerText">
    <item name="android:textSize">20dp</item>
    <item name="android:textColor">@color/white</item>
 </style>
 </resources>

main_activity.xml :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:id="@+id/parentLayout_homesearch"
  android:layout_width="match_parent"
  android:layout_height="fill_parent"
  android:background="@color/white"
  android:orientation="vertical">
 <NumberPicker
 android:theme="@style/NumberPickerText"
 android:id="@+id/numberPicker1"
 android:layout_width="150dp"
 android:layout_height="wrap_content"
 android:layout_alignParentStart="true" />
</LinearLayout>
0

There are 0 answers