AndroidPicker icon indicating copy to clipboard operation
AndroidPicker copied to clipboard

日期选择器

Open sun55 opened this issue 4 years ago • 1 comments
trafficstars

能给年,月,日单独设置背景吗

sun55 avatar Jun 25 '21 03:06 sun55

能给年,月,日单独设置背景吗

能的,例如:

        DatePicker picker = new DatePicker(this);
        picker.setOnDatePickedListener(this);
        picker.setBodyWidth(240);
        picker.setBackgroundColor(0xEEDDDDDD);
        picker.getHeaderView().setBackgroundColor(0xFFCCCCCC);
        DateWheelLayout wheelLayout = picker.getWheelLayout();
        wheelLayout.setDateMode(DateMode.YEAR_MONTH_DAY);
        wheelLayout.setDateLabel("年", "月", "日");
        wheelLayout.setRange(DateEntity.today(), DateEntity.target(2050, 12, 31), DateEntity.today());
        wheelLayout.setCurtainEnabled(true);
        wheelLayout.setCurtainColor(0xFFCC0000);
        wheelLayout.setIndicatorEnabled(true);
        wheelLayout.setIndicatorColor(0xFFFF0000);
        wheelLayout.setIndicatorSize(view.getResources().getDisplayMetrics().density * 2);
        wheelLayout.setTextColor(0xCCCC0000);
        wheelLayout.setSelectedTextColor(0xFF00FF00);
        wheelLayout.getYearWheelView().setBackgroundColor(0x90CCCCCC);
        wheelLayout.getMonthWheelView().setBackgroundColor(0x90CCCCCC);
        wheelLayout.getDayWheelView().setBackgroundColor(0x90CCCCCC);
        picker.show();

微信截图_20210630151342

liyujiang-gzu avatar Jun 30 '21 06:06 liyujiang-gzu