android日期选择控件
16lz
2021-01-26
PickTime
日期选择控件
效果
源码地址:pickTime 欢迎start~
DateType
- TYPE_ALL–年、月、日、星期、时、分
- TYPE_YMDHM–年、月、日、时、分
- TYPE_YMDH–年、月、日、时
- TYPE_YMD–年、月、日
- TYPE_HM–时、分
how to use
- Add it in your root build.gradle at the end of repositories:
allprojects { repositories { ... maven { url 'https://jitpack.io' } } }
- Add the dependency
dependencies { compile 'com.github.codbking:PickTime:v1.0.0' }
- java
DatePickDialog dialog = new DatePickDialog(this); //设置上下年分限制 dialog.setYearLimt(5); //设置标题 dialog.setTitle("选择时间"); //设置类型 dialog.setType(DateType.TYPE_ALL); //设置消息体的显示格式,日期格式 dialog.setMessageFormat("yyyy-MM-dd HH:mm"); //设置选择回调 dialog.setOnChangeLisener(null); //设置点击确定按钮回调 dialog.setOnSureLisener(null); dialog.show();
更多相关文章
- 设置当TextView中的文字超过TextView的容量时,用省略号代替
- android文本编辑工具类之SpannableStringUtils
- Android中的时间:currentTimeMillis,uptimeMillis,elapsedRealtime
- Android(安卓)Studio将程序中的文言生成到string.xml中
- Android系统Intent中的Uri使用
- Android(安卓)动画效果:四种基础动画的
- Activity configuration change
- android中在androidmanifest.xml设置权限请求
- Android开源组件SlidingMenu的基本使用方法和SlidingMenuDemo