在DatePicker的设置自定义日期 [英] Setting custom date in DatePicker

查看:130
本文介绍了在DatePicker的设置自定义日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有可能来设置DatePicker的自定义日期?
我想设置一个的DatePicker日期,然后允许用户编辑。
谢谢!

Is there possibility to set a custom date in DatePicker? I want to set a date in DatePicker, and then allow user to edit it. Thanks!

推荐答案

你见过的这个的教程?它说,最初设定的DatePicker,使用DatePicker.init:

Have you seen this tutorial? It says to set the DatePicker initially, use DatePicker.init:

Calendar cal=Calendar.getInstance(Locale.ENGLISH);
dp.init(cal.getTime().getYear()+1900, cal.getTime().getMonth(), cal.getTime().getDay(), this);

这篇关于在DatePicker的设置自定义日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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