小编use*_*912的帖子

如何在iOS 7中更改UIPickerView中的文本字体?

我能够改变我的字体颜色,但我还需要更改字体大小,我该如何实现?这是我的颜色代码,

 - (NSAttributedString *)pickerView:(UIPickerView *)pickerView attributedTitleForRow:(NSInteger)row forComponent:(NSInteger)component {
    NSString *title = _currencyName[row];
    NSAttributedString *attString = [[NSAttributedString alloc] initWithString:title attributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];

    return attString;
 }
Run Code Online (Sandbox Code Playgroud)

更新:这不起作用:

 NSAttributedString *attString = [[NSAttributedString alloc] initWithString:title attributes:@{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName: [UIFont fontWithName:@"HelveticaNeue-Light" size:40]}];
Run Code Online (Sandbox Code Playgroud)

fonts picker ios

37
推荐指数
4
解决办法
3万
查看次数

标签 统计

fonts ×1

ios ×1

picker ×1