获取Material Design TimePicker-Android? [英] getting the Material Design TimePicker - android?

查看:108
本文介绍了获取Material Design TimePicker-Android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在我的应用程序中使用 TimePicker / TimePickerDialog ,虽然我正在查看,但我正在获取 timePickerMode ="spinner" 样式的小部件用于的是 timePickerMode ="clock" .这是我做过的样式

if i use TimePicker/TimePickerDialog in my app i'm getting timePickerMode="spinner" styled widget though what i'm looking for is timePickerMode="clock". this is the style I've done

<style name="timePicker_dialog parent="android:Theme.Material.Light">
<item name="timePickerMode">clock</item>
</style>

,我通过它的 TimePickerDialog()将它设置为 TimePicker 中的样式,但是我仍然可以使用微调器.它取决于设备吗?我的手机正在运行v4.4.4?如果没有,我在这里想念的是什么.谢谢!

and I've set this res as the style in the TimePicker via it's TimePickerDialog(), butt i'm still getting the spinner. is it device dependent? my phone is running v4.4.4? if not, what am i missing here. thanks!

推荐答案

截至2020年末, MaterialTimePicker 处于Material软件包的测试版中.
因此,您可以将以下内容添加到您的应用Gradle中:

As of late 2020, MaterialTimePicker is in the beta version of the Material package.
Therefore you can add the following to your app Gradle:

dependencies { ...
     implementation 'com.google.android.material:material:1.3.0-beta01'
}

然后使用 MaterialTimePicker 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆