Personalizar DatePicker/CalendarView
Frecuentes
Visto 803 veces
1
¿Hay alguna forma de personalizar el Selector de fechas y/o Vista de calendario such that only specified fields appear. For e.g. in one instance, I'd like to see the DatePicker
appear with only the month field showing, in another, I want it to appear with all but the year showing.
I've looked at creating custom controls, but that's really too much. I'm looking for a simple way to extend the existing controls.
1 Respuestas
-1
sí,
XML attribute..
<DatePicker android:calendarViewShown="false"/>
Usando Java:
Deje que el DatePicker
you created has id: d1
so the code follows:
DatePicker selectDate =(DatePicker) findViewById(R.id.d1);
selectDate.setCalendarViewShown(false);
si estas creando DatePicker
dinamicamente:
DatePicker selectDate = new DatePicker(this);
selectDate.setCalendarViewShown(false);
respondido 14 mar '13, 06:03
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas android or haz tu propia pregunta.
Can anyone please tell me why am I downvoted... I guess this is correct answer and it works. - Veer Shrivastav