Use Datepicker in an Activity

Asked

Viewed 91 times

2

Hello! , I am trying to make a datepicker part of the Activity layout as shown below:

Registo no Facebook

I’ve been searching the Internet, but all the examples I find speak of Datepickerdialog, and that’s not what I intended. Some Solution? Thank you!

  • Welcome to Stack Overflow in Portuguese. In case you Haven’t noticed, this is the SO Portuguese community, if you’re Looking to get help in English Please visit the SO English Community. If you’re Looking to get help in English, Please Edit and Translate your Question.

  • Thanks, I thought it was the site itself to translate, I will translate and put also in the SO English Community.

1 answer

2


There is the Datepicker which can be used as a view normal in any layout.

To be displayed as it is in the image of the question you must use the attributes datePickerMode and calendarViewShown with the following values:

android:datePickerMode="spinner"
android:calendarViewShown="false"
  • Exactly, that’s exactly what I wanted! Thank you! I needed to change the color of the font, there is form?

  • Glad I could help and welcome to Stackoverflow. See here how to proceed when a reply has been useful to you. Regarding the source color see this.

  • I had seen this post, but results without success

  • The problem is that there are several versions of Datepicker, it has changed with new versions of Android.

  • I will open a new post, see if I can get a reply, thanks again!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.