Android 向日期选择器添加自定义文本/注释

Android 向日期选择器添加自定义文本/注释,android,datepicker,Android,Datepicker,我们如何在android日期选择器上添加自定义便笺呢?我已经在很多网站上搜索过这个问题了。这是一个简单的布局示例。只需在对话框中打开它,然后处理从日历中获得的数据。或者你也可以尝试制作你的个人日期选择器,这是你的选择 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout


我们如何在android日期选择器上添加自定义便笺呢?我已经在很多网站上搜索过这个问题了。

这是一个简单的布局示例。只需在对话框中打开它,然后处理从日历中获得的数据。或者你也可以尝试制作你的个人日期选择器,这是你的选择

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="1dp"
        android:orientation="horizontal">


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="vertical">

            <CalendarView
                android:id="@+id/calendarView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <Button
                android:id="@+id/button"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Submit" />

            <TextView
                android:id="@+id/textView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Here we have some notes" />
        </LinearLayout>

    </LinearLayout>

</RelativeLayout>


也许这是一个自定义布局,有
日期选择器
按钮
文本视图
。创建一个自定义视图,包括日历视图+按钮+文本视图,并使用它。我也创建了片段,但我不知道如何在我的活动中使用它。如何使用,从什么意义上说?,如何在对话框中创建或如何从日历中读取数据?请解释您的问题