UIPickerView控件中自定义展示的字体大小及样式

- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view{

    UILabel* pickerLabel = (UILabel*)view;

    if (!pickerLabel){

        pickerLabel = [[UILabel alloc] init];

        pickerLabel.adjustsFontSizeToFitWidth = YES;

        pickerLabel.font=[UIFont systemFontOfSize:17];

        pickerLabel.textAlignment=NSTextAlignmentCenter;

    }

    pickerLabel.text=[self pickerView:pickerView titleForRow:row forComponent:component];

    return pickerLabel;

}

原文地址:https://www.cnblogs.com/CityPe/p/6227004.html