This is a datePicker which you can set as what you want(这个时间选择器你可以自由定义).
self.datePicker.selectedLabelColor = [UIColor yellowColor];
self.datePicker.otherLabelColor = [UIColor blueColor];self.datePicker.selectedTextFont = [UIFont systemFontOfSize:17];
self.datePicker.selectedTextColor = [UIColor blueColor];
self.datePicker.otherTextFont = [UIFont systemFontOfSize:15];
self.datePicker.otherTextColor = [UIColor grayColor];// color
self.datePicker.seperateLineColor = [UIColor redColor];
//width
self.datePicker.seperatorWidth = 60;//Default
self.datePicker.pickerViewType = PickerViewTypeLongSperator;//Dynamic seperate line
self.datePicker.pickerViewType = PickerViewTypeDynamicSperator;//Static seperate line
self.datePicker.pickerViewType = PickerViewTypeStaticSperator;//yyyy-MM-dd HH:mm
self.datePicker.dateShowType = DateShowingTypeYMDHM;//yyyy-MM-dd HH:mm:ss
self.datePicker.dateShowType = DateShowingTypeYMDHMS;//yyyy-MM-dd HH
self.datePicker.dateShowType = DateShowingTypeYMDH;//yyyy-MM-dd
self.datePicker.dateShowType = DateShowingTypeYMD;//MM-dd HH:mm
self.datePicker.dateShowType = DateShowingTypeMDHM;//dd HH:mm
self.datePicker.dateShowType = DateShowingTypeDHM; self.datePicker.componentWidth = 70;
self.datePicker.rowHeight = 30; self.datePicker.yearUnit = @"年";
self.datePicker.monthUnit = @"月";
self.datePicker.dayUnit = @"日";
self.datePicker.hourUnit = @"时";
self.datePicker.miniteUnit = @"分";
self.datePicker.secondUnit = @"秒"pod XMDatePicker
(调用方法- (void)showPickerView展示pickerView)
There are two protocol methods Which are - (void)pickerView:(XMDatePicker *)pickerView didSelectedDateString:(NSString *)dateString and - (void)pickerView:(XMDatePicker *)pickerView didClickOkButtonWithDateString:(NSString *)dateString.
If you need not click the confirmation button transmit date strings, you can implement the first method, otherwise the second.
有两个代理方法,分别是- (void)pickerView:(XMDatePicker *)pickerView didSelectedDateString:(NSString *)dateString和- (void)pickerView:(XMDatePicker *)pickerView didClickOkButtonWithDateString:(NSString *)dateString,如果你不需要点击“确认”按钮去最终确定所选择的日期,而是滑动转轮的同时更新日期,那么你可以实现第一个代理方法,否则就实现第二个代理方法
If you find a bug, please tell me.My E-mail address is 1179102890@qq.com. If you have a good idea ,you can discuss with me.
最后,我在《XMDatePicker的写作思路》中简要讲了一下处理分割线的问题,有什么问题希望大家批评指正!


