1
我要創建的時間段選擇對話框按低於預定的圖像:如何在Android中創建插槽選擇器(分鐘/小時)?
有誰有任何想法我怎麼能做到這一點?我們有日期和時間選取器,但是我們在Android中沒有這種類型的本地選取器。謝謝
我要創建的時間段選擇對話框按低於預定的圖像:如何在Android中創建插槽選擇器(分鐘/小時)?
有誰有任何想法我怎麼能做到這一點?我們有日期和時間選取器,但是我們在Android中沒有這種類型的本地選取器。謝謝
您可以使用控制NumberPicker
例:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="match_parent">
<NumberPicker
android:id="@+id/number_picker_hour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:configChanges="keyboard|keyboardHidden" />
<NumberPicker
android:id="@+id/number_picker_min"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:configChanges="keyboard|keyboardHidden" />
</LinearLayout>
你可以試試這個庫[https://github.com/gzu-liyujiang/AndroidPicker] (https://github.com/gzu-liyujiang/AndroidPicker) – KeLiuyue