Android Date Picker显示不需要的视图
val datePickerDialog = DatePickerDialog(
this@AddTaskActivity,
R.style.DateTimePickerTheme,
startDatePickerListener,
myCalendar
.get(Calendar.YEAR),
myCalendar.get(Calendar.MONTH),
myCalendar.get(Calendar.DAY_OF_MONTH)
)
<style name="DateTimePickerTheme" parent="Theme.AppCompat.Light.Dialog">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/theme_blue</item>
</style>
上面是我的代码,视图显示如上图1。 但预期如下图2。 有不需要的日期是日期选择器
val datePickerDialog = DatePickerDialog(
this@AddTaskActivity,
R.style.DateTimePickerTheme,
startDatePickerListener,
myCalendar
.get(Calendar.YEAR),
myCalendar.get(Calendar.MONTH),
myCalendar.get(Calendar.DAY_OF_MONTH)
)
<style name="DateTimePickerTheme" parent="Theme.AppCompat.Light.Dialog">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/theme_blue</item>
</style>
above is my code , view showing as above image 1.
but expected as below image 2.
there is Unwanted date is top of the date picker
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须删除标题栏。删除标题栏。使用此代码
,并且不要致电datepickerdialog.settitle(“ title”)
如果使用
You have to remove title bar. To Remove title bar.. use this code
And Don't call datePickerDialog.setTitle("title")
Remove setTitle if you use