Create a time picker screen similar to the one Alarm app in Android wear

女生的网名这么多〃 提交于 2019-12-23 01:35:28

问题



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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!