答案 0 :(得分:1)
您可以使用控件 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>
答案 1 :(得分:0)