// 设置PickerView分割线属性&字体属性
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
{
// 设置分割线的颜色
for(UIView *singleLine in pickerView.subviews)
{
if (singleLine.frame.size.height < 1)
{
singleLine.backgroundColor = [UIColor colorWithRed:50/255.0 green:50/255.0 blue:50/255.0 alpha:1.0];
}
}
// 设置文字的属性
UILabel *pickerLabel = [[UILabel alloc] init];
pickerLabel.text = self.hours_Array[row];
pickerLabel.textAlignment = NSTextAlignmentCenter;
pickerLabel.textColor = [UIColor whiteColor];
pickerLabel.font = [UIFont systemFontOfSize:23];
// pickerLabel.font = [UIFont boldSystemFontOfSize:30];// ------加粗字体
return pickerLabel;
}
网友评论