2015-10-20 71 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

不,它不工作 –