UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(110, 35, 180, 30)] autorelease];
label.text = @"測試";
label.font = [UIFont fontWithName:@"Arial-BoldMT" size:20]; //設定粗字體
label.textColor = [UtilFuncs transferHexColorCode:@"#50860e"];
label.backgroundColor = [UIColor clearColor];
在iOS中,沒有設定粗體這東西,完全要靠字體本身,所以上述Example才會用Arial-BoldMT,不過我想這才是正常的做法吧。
參考網址:
https://discussions.apple.com/thread/1533499?start=0&tstart=0