问题
I am developing a wearable app where I need to create a Time picker for my app.
The time picker that is used for mobiles wont fit for wearable. I need to create a picker similar to the one I see in Alarm app in Android watch. Can anyone help me how to implement that type of time picker screen in my app.
Thanks in Advance.
回答1:
TimePicker uses by default clock mode, so by setting it manually to spinner, you'll get view that is more suitable for Wear devices.
Do it by setting timePickerMode to spinner.
<TimePicker
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/timePicker"
android:timePickerMode="spinner"/>
来源:https://stackoverflow.com/questions/35093725/create-a-time-picker-screen-similar-to-the-one-alarm-app-in-android-wear