Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

日期选择器 #243

Open
sun55 opened this issue Jun 25, 2021 · 1 comment
Open

日期选择器 #243

sun55 opened this issue Jun 25, 2021 · 1 comment

Comments

@sun55
Copy link

sun55 commented Jun 25, 2021

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

@liyujiang-gzu
Copy link
Member

liyujiang-gzu commented Jun 30, 2021

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

能的,例如:

        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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants