cell.textLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:8.0];
是否可以动态地将字体系列和大小的名称传递给iPhone中单元格的标签文本?
NSString *selectorString =@"Helvetica-Bold";
cell.textLabel.font = [UIFont fontNamesForFamilyName:@"%@",selectorString];
答案 0 :(得分:2)
试试这个可以帮助你。
UILabel *titlelbl=[[UILabel alloc] initWithFrame:CGRectMake(80, 0, 150, 40)];
titlelbl.font = [UIFont fontWithName:@"Helvetica-Bold" size:17];
titlelbl.textAlignment=UITextAlignmentCenter;
titlelbl.textColor=[UIColor blackColor];
答案 1 :(得分:0)
你可以像这样设置
float fontSize = 14.0f;
NSString *selectorString =@"Helvetica-Bold";
cell.textLabel.font = [UIFont fontWithName:[NSString stringWithFormat:@"%@",selectorString] size:fontSize];
答案 2 :(得分:0)
#define FONT_HELVETICA_BOLD @"Helvetica-Bold"
#define FONT_SIZE 14.of
cell. textLabel.font=[UIFont fontWithName:FONT_HELVETICA_BOLD size:FONT_SIZE];