实现日历和时间选择器的最佳方法是啥? [关闭]

Posted

技术标签:

【中文标题】实现日历和时间选择器的最佳方法是啥? [关闭]【英文标题】:What is best way to implement calendar and time picker? [closed]实现日历和时间选择器的最佳方法是什么? [关闭] 【发布时间】:2019-05-30 17:37:49 【问题描述】:

我必须执行 CalendarTimePicker 我附上了图片,请查看并回答我实现此的最佳方法是什么。

提前致谢

请看这张图片

【问题讨论】:

对于第一部分,您可以使用水平回收视图。对于第二部分,您可以使用 NumberPicker 【参考方案1】:

对于日期选择,您可以使用 Mulham-Raee 中的 Horizo​​ntalCalendarView 或 mybringback22 中的 Horizo​​ntalCalendarView 到您的 xml 中。

<devs.mulham.horizontalcalendar.HorizontalCalendarView
            android:id="@+id/calendarView"
            android:layout_
            android:layout_
            app:textColorNormal="#bababa"
            app:textColorSelected="#FFFF"
            app:selectorColor="#c62828"  //default to colorAccent
            app:selectedDateBackground="@drawable/myDrawable"/>

<com.view.calender.horizontal.umar.horizontalcalendarview.HorizontalCalendarView
        android:id="@+id/horizontalcalendarview"
        android:layout_
        android:layout_>
 </com.view.calender.horizontal.umar.horizontalcalendarview.HorizontalCalendarView>

对于时间选择器,您可以使用androidTimePicker。还 有wheel picker,你可以用这个来设计你的时间选择器

<LinearLayout
        android:id="@+id/timepicker"
        android:layout_
        android:layout_
        android:orientation="horizontal"
        android:layout_below="@+id/calendarView"
        android:gravity="center_horizontal">
        <com.aigestudio.wheelpicker.WheelPicker
            android:id="@+id/hour"
            app:wheel_item_text_size="20sp"
            android:layout_
            android:layout_
            app:wheel_item_space="10dp"
            app:wheel_same_
            app:wheel_atmospheric="true"
            app:wheel_curved="true"
            app:wheel_cyclic="true"
            app:wheel_item_align="right"
            app:wheel_item_text_color="#A7A7DB"
            app:wheel_selected_item_text_color="#536D8A"
            app:wheel_visible_item_count="3"/>
        <View
            android:layout_
            android:layout_/>
        <com.aigestudio.wheelpicker.WheelPicker
            android:id="@+id/minute"
            android:layout_
            android:layout_
            app:wheel_item_space="10dp"
            app:wheel_same_
            app:wheel_atmospheric="true"
            app:wheel_curved="true"
            app:wheel_cyclic="true"
            app:wheel_item_text_color="#A7A7DB"
            app:wheel_item_text_size="20sp"
            app:wheel_selected_item_text_color="#536D8A"
            app:wheel_visible_item_count="3"/>
        <View
            android:layout_
            android:layout_/>
        <com.aigestudio.wheelpicker.WheelPicker
            android:id="@+id/am_pm"
            app:wheel_item_text_size="20sp"
            android:layout_
            android:layout_
            app:wheel_item_space="10dp"
            app:wheel_same_
            app:wheel_atmospheric="true"
            app:wheel_curved="true"
            app:wheel_item_align="right"
            app:wheel_item_text_color="#A7A7DB"
            app:wheel_selected_item_text_color="#536D8A"
            app:wheel_visible_item_count="2"
             />

</LinearLayout>

【讨论】:

以上是关于实现日历和时间选择器的最佳方法是啥? [关闭]的主要内容,如果未能解决你的问题,请参考以下文章

.NET 进程间通信的最佳选择是啥? [关闭]

.NET 进程间通信的最佳选择是啥? [关闭]

QR码阅读的最佳选择是啥[关闭]

Excel中进行插入日期选择器的操作技巧

在 Ruby on Rails 中搜索的最佳选择是啥? [关闭]

在 Windows 2003 上运行 Jabber/XMPP 的最佳选择是啥? [关闭]