iOS风格 年月日 选择器

来源:互联网 发布:windows桌面插件api 编辑:程序博客网 时间:2024/06/10 15:02


PickView(iOS 风格年月日选择)
https://github.com/brucetoo/PickView

1.导入依赖
compile 'com.brucetoo.pickview:library:1.2.3'


2.代码中直接使用
DatePickerPopWin pickerPopWin = new DatePickerPopWin.Builder(MainActivity.this, new DatePickerPopWin.OnDatePickedListener() {
@Override
public void onDatePickCompleted(int year, int month, int day, String dateDesc) {
Toast.makeText(MainActivity.this, dateDesc, Toast.LENGTH_SHORT).show();
}
}).textConfirm("确定") //text of confirm button
.textCancel("取消") //text of cancel button
.btnTextSize(16) // button text size
.viewTextSize(25) // pick view text size
.colorCancel(Color.parseColor("#999999")) //color of cancel button
.colorConfirm(Color.parseColor("#009900"))//color of confirm button
.minYear(1980) //min year in loop
.maxYear(2050) // max year in loop
.showDayMonthYear(false) // shows like dd mm yyyy (default is false)
.dateChose("2013-11-11") // date chose when init popwindow
.build();

pickerPopWin.showPopWin(this);
原创粉丝点击