Closed coooliang closed 4 years ago
只支持UIPickerView不支持UIDatePicker是吗?
是的呢,UIDatePicker是系统样式,目前只支持自定义UIPickerView的样式
设置一下日期的mode
datePickerView.pickerMode = BRDatePickerModeYMD;
设置一下日期的mode
datePickerView.pickerMode = BRDatePickerModeYMD;
非常感谢,没想到这么快就回复我了!~ 确实可行
BRPickerStyle *customStyle = [[BRPickerStyle alloc]init];
customStyle.titleBarColor = [UIColor whiteColor];
customStyle.doneColor = [UIColor whiteColor];
customStyle.doneTextColor = [UIColor blackColor];
customStyle.cancelColor = [UIColor whiteColor];
customStyle.cancelTextColor = [UIColor blackColor];
customStyle.titleLineColor = [UIColor whiteColor];
customStyle.titleTextColor = [UIColor grayColor];
customStyle.pickerColor = [UIColor whiteColor];
customStyle.alertViewColor = [UIColor whiteColor];
customStyle.selectRowTextColor = [UIColor blackColor];
customStyle.selectRowColor = [UIColor whiteColor];
customStyle.separatorColor = [UIColor grayColor];
customStyle.pickerTextColor = [UIColor blackColor];
BRDatePickerView *datePickerView = [[BRDatePickerView alloc]init];
datePickerView.pickerMode = BRDatePickerModeYMD;
datePickerView.pickerStyle = customStyle;
datePickerView.title = @"请选择日期";
datePickerView.selectDate = [NSDate date];
datePickerView.resultBlock = ^(NSDate *selectDate, NSString *selectValue) {
};
[datePickerView show];
暗黑模式下设置白色不生效,我看是因为BRDatePickerView+BR.m的方法中的self.pickerStyle.selectRowColor为nil啊
我是这样调用的: