Android Studio 3.1 Layout Editor 中的TimePicker 在哪里 [英] Android Studio 3.1 Where is the TimePicker in the Layout Editor
问题描述
升级到 Android Studio 3.1 时,布局编辑器面板中没有 TimePicker.
搜索没有找到.
事实上,所有的选择器控件似乎都消失了.他们在 3.0 中就在那里.
On upgrade to Android Studio 3.1 there is no TimePicker in the layout editor palette.
Search doesn't find it.
In fact all of the picker controls seem to have vanished.
They were there in 3.0.
推荐答案
我不确定在选择菜单中的何处可以找到它,但如果您只需要在项目中使用时间选择器,您可以选择 Text
activity.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
.
希望这会有所帮助.
这篇关于Android Studio 3.1 Layout Editor 中的TimePicker 在哪里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!