Ask a Question
Advertise on boostr.in
how to turn off calendarview in a datepicker using -'android,android-layout'
how to turn off calendarview in a datepicker ¬†using -'android,android-layout'
On my settings screen I have a date picker widget. In the designer in Eclipse, it shows as I want (3 spinners for D-M-Y) but when I test on my device, I get a rather odd view with a side spinner on the left and a calendar on the right. Never seen this before(!) but doing some research I think I'm seeing the "CalendarView".
I found that I should be able to set a "calendarViewShown" property to false- but my XML throws an error with this. I found another question on here that suggested the API level was to blame (my minSDKLevel is 7, but I'm targetting 11 so I can get the action bar button rather than the oldskool menu).
So I thought I'd try setting it in code:
¬†¬†¬†¬†int currentapiVersion = android.os.Build.VERSION.SDK_INT;
¬†¬†¬†¬†if (currentapiVersion >= 11)
¬†¬†¬†¬†¬†¬†¬†¬†minDateSelector.setCalendarViewShown = false;
But again, this fails- setCalendarViewShown isn't found. But the docs here say it should exist.
Sep 7, 2015
to add a comment.
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
To avoid this verification in future, please