Ali Bavi
Ali Bavi

Reputation: 78

Can't find DatePicker in XML layouts

In previous Android studio version I used DatePicker but now in 3.1 version doesn't exist anything as the same. Is it any replacement for that?

Upvotes: 2

Views: 1626

Answers (2)

Sai Tarun Kaniganti
Sai Tarun Kaniganti

Reputation: 115

In version 3.1.2, the Date Picker widget is present in the XML file.

<DatePicker
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

</DatePicker>

In an earlier version, the date picker used to be present in the Palette but from v3.1.2 onwards it has been removed from Palette, so we need to write it in XML.

Upvotes: 2

ravi
ravi

Reputation: 1001

The DatePicker widget in XML is not removed or anything, if that is what you are asking. Below is a proof of DatePicker widget on Android Studio 3.1.2 DatePicker in Android Studio 3.1.2

Try clean project, Build Project and restart IDE to see if the DatePicker in XML reappears.

Upvotes: 0

Related Questions