-1
cell.textLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:8.0];

是否可以动态传递字体系列的名称和大小来标记 iPhone 中单元格的文本?

NSString *selectorString =@"Helvetica-Bold";
cell.textLabel.font = [UIFont fontNamesForFamilyName:@"%@",selectorString];
4

3 回答 3

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];
于 2013-03-25T07:00:17.050 回答
0
#define FONT_HELVETICA_BOLD @"Helvetica-Bold"
#define FONT_SIZE 14.of

cell. textLabel.font=[UIFont fontWithName:FONT_HELVETICA_BOLD size:FONT_SIZE];
于 2013-03-25T07:05:33.053 回答
0

你可以这样设置

float fontSize = 14.0f;
NSString *selectorString =@"Helvetica-Bold";
cell.textLabel.font = [UIFont fontWithName:[NSString stringWithFormat:@"%@",selectorString] size:fontSize];
于 2013-03-25T06:48:45.577 回答