2017-02-09 279 views
0

因此,我在我的应用程序中使用了TimePickerDialog,但它默认为我不想使用的时钟样式。我想使用微调样式。如何更改R.styleable的值

如果你看看这里:https://developer.android.com/reference/android/R.styleable.html#TimePicker_timePickerMode

看起来这应该是我可以很容易地通过TimePicker_timePickerMode的值设置为1改变,但我不知道该怎么做。我怎样才能改变这个变量的值?

我一直在努力谷歌搜索,一直没能找到关于R.styleable类的任何信息。该文档只列出了一堆没有其他信息的常量。有没有更好的文档解释这个类如何工作或如何使用它?

+0

有2方法添加[timePickerMode](http://stackoverflow.com/questions/24449723/is-it-possible-to-change -the-风格的-AN-机器人-1- timepickerdialog) – niju

回答

0

您可以覆盖它在布局.xml文件:

<TimePicker 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:timePickerMode="spinner"> 

</TimePicker>