calendarViewShown is not being honored on Android 5.0 Lollipop

后端 未结 2 2025
眼角桃花
眼角桃花 2021-01-07 22:42

I am working through The Big Nerd Ranch\'s Android Guide. In the assignment Criminal Intent I am using DatePicker with following layout.

On pre-5.0 devices, calendar

相关标签:
2条回答
  • 2021-01-07 23:08

    The solution has been posted here

    You have to use both android:calendarViewShown="false" and android:datePickerMode="spinner".

    This solves it.

    <DatePicker xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/dialog_date_datePicker"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:calendarViewShown="false"
        android:datePickerMode="spinner" >
    </DatePicker>
    
    0 讨论(0)
  • 2021-01-07 23:34

    Below code worked for me

    new DatePickerDialog(getActivity(),android.R.style.Theme_Holo_Dialog, this, year,month, day);
    
    0 讨论(0)
提交回复
热议问题