2015-10-20 72 views
0

更改uipickerview标题文本中的字体样式。 我想改变只有选定的标题行字体样式是粗体和其他标题文字是正常的font.change标题字体样式我想要的字体样式是Helvetica Neue Bold。如何更改uipickerview标题文本中的字体样式?

+0

谢谢主席先生,但在这个环节上的所有pickerview粗体文字,我想唯一入选的标题的文字字体变化 –

+0

检查与此http://stackoverflow.com/a/19825249/5362916 –

+0

字体风格会更改NSAttributedString –

回答

0
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view 
{ 
    if(row == yourSelectedIndex)//to set as bold 
    { 
    UILabel* tView = (UILabel*)view; 
    if (!tView) 
    { 
     tView = [[UILabel alloc] init]; 
     [tView setFont:[UIFont boldFontWithSize:14"]]; 
    } 
    [email protected]"your text values"; 
    return tView; 
    } 
} 
+0

不,它不工作 –