CalendarViewShown property not available on DatePicker on newer devices when MinAndroidAPI is 10

I have an app where the minimum android is api version 10 but the target api version is 16, when I use the DatePicker control on a old 2.3 device the date picker works as I would expect with the day, month and year pickers. However, on an 4.1 device the date fields have a calendar view displayed, which I don't want.

I believe that if I set the CalendarViewShown property to false then it will not display, but that property is not available in Visual Studio unless I change the minimum api version.

I have tried checking for the property using reflection but I am guessing that because the MonoAndroid run time that the app references does not have that property I cannot access it.

Is there a way to set this on the newer devices, either by accessing the underlying DatePicker java control or via some other means?

Answers

  • MichaelBurgessMichaelBurgess AUMember ✭✭

    Never mind, I clicked the show advanced properties and found the android:calendarViewShown property in the layout file. Setting this in the layout works fine in the older version and does exactly what I want in the newer version.

Sign In or Register to comment.