/**
*
* 设置时间选择器的分割线颜色
* @param datePicker
*/
private void setDatePickerDividerColor(DatePicker datePicker){
// Divider changing:
// 获取 mSpinners
LinearLayout llFirst = (LinearLayout) datePicker.getChildAt();
// 获取 NumberPicker
LinearLayout mSpinners = (LinearLayout) llFirst.getChildAt();
for (int i = ; i < mSpinners.getChildCount(); i++) {
NumberPicker picker = (NumberPicker) mSpinners.getChildAt(i);
Field[] pickerFields = NumberPicker.class.getDeclaredFields();
for (Field pf : pickerFields) {
if (pf.getName().equals("mSelectionDivider")) {
pf.setAccessible(true);
try {
pf.set(picker, new ColorDrawable(ResourceUtil.getColor(R.color.com_text_red)));
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (NotFoundException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
break;
}
}
}
}