Search code examples
androidandroid-layoutandroid-datepickerandroid-timepicker

Datepicker and Timepicker text does not appear in Android 5.1.1


date and time picker looking like that in android 5.1.1

code for my datepicker and timepicker is:

<DatePicker
            android:id="@+id/datePicker1"
            android:layout_width="wrap_content"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:calendarTextColor="#000000"
            android:theme="@android:style/Theme.Holo"
            android:calendarViewShown="false">
        </DatePicker>

        <TimePicker
            android:id="@+id/timePicker1"
            android:layout_width="wrap_content"
            android:layout_height="0dp"
            android:numbersTextColor="#000000"
            android:amPmTextColor="#000000"
            android:theme="@android:style/Theme.Holo"
            android:layout_weight="1" >
        </TimePicker>

It looks perfact on other devices with different android versions. Please suggest how to solve this problem.

EDIT: Android 5.1.1 uses different theme for date and time picker but i need to show the holo theme, so i changed date and time picker theme manually. it has changed but now its shows like the screenshot, i.e. text does not appear(or may be text is with white color). i also changed text color in xml code but it still does not appear. How can i make text vissible in this.


Solution

  • Found solution, i just changed theme of my datepicker and timepicker from android:theme="@android:style/Theme.Holo"

    to

                android:theme="@android:style/Theme.Holo.Light"
    

    and text appears now.