且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android Studio 3.1 Layout Editor 中的TimePicker 在哪里

更新时间:2023-01-17 10:38:34

我不确定在选择菜单中的何处可以找到它,但如果您只需要在项目中使用时间选择器,您可以选择 Textactivity.xml 文件底部的 code> 选项卡并粘贴 TimePicker xml.

I am not sure where to find it in the selection menu but if you just need a time picker in your project you can select the Text tab on the bottom of your activity.xml file and paste the TimePicker xml.

<TimePicker
android:id="@+id/simpleTimePicker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:timePickerMode="spinner"/>

然后你可以选择你想要的 timePickerMode 如果你想要一个时钟然后用 clock 改变 spinner.

Then you can select which timePickerMode you want if you want a clock then change spinner with clock.

希望这会有所帮助.