Android组件开发之日期选择器DatePicker
第一步:打开Android Studio,在资源res中找到布局layout的activity_main.xml
第二步:编写以下代码
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<DatePicker
android:id="@+id/datapicker"
android:layout_width="match_parent"
android:layout_height="m