Skip to content Skip to sidebar Skip to footer

Why Does The Datepicker Add A Calendar In My View?

I am starting to learn how to develop on Android. It is pretty straightforward but I'm facing an issue I did not find any mention anywhere... I have a view :

Solution 1:

Add this line to your date picker xml

android:calendarViewShown="false"

This will remove the Calendar.

Solution 2:

All you need add under the:

<datepicker>

method, just add:

 android:calendarViewShown="false"

This will remove the calendar, but keep the scroller.

Hope this helps

Solution 3:

I had the same problem. I haven't created any xml file. So I fixed by changing the value of calendarviewshow in Activity. Hope it will help somebody.

We can hide the calendar view in DatePicker using two methods.

1 In Layout(XML file)(Thanks to @coconess)

<DatePicker
    android:id="@+id/datepickerv1"
    android:calendarViewShown="false">

2 In Activity(Java file)

Note:If you are notusing"calendarViewShow"in xml, follow this step.
DatePicker dp=(DatePicker)findViewById(R.id.datepickerv1);
dp.setCalendarViewShown(false);

Solution 4:

Change your datepicker from xml as follows :

<DatePickerandroid:id="@+id/dpDateAchatProduit"android:layout_width="wrap_content"android:layout_height="wrap_content"android:calendarViewShown="false" />

Solution 5:

Add

android:datePickerMode="spinner"

instead of

android:calenderViewShown="false"

Post a Comment for "Why Does The Datepicker Add A Calendar In My View?"