2012-11-27 31 views
0

我想设置字体类型,我的标签文本,但它不seted .....文字字体没有设置?

我的代码....

CGRect imageFrame = CGRectMake(10, 10, 150, 80); 
    labelResizableView = [[UserResizableView alloc] initWithFrame:imageFrame]; 
    alabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 35, 100, 100)]; 

alabel.font = [UIFont fontWithName:@"AmericanTypewriter-Bold" size:18]; 
+0

iOS上支持'AmericanTypewriter-Bold'字体吗?你看过'NSLog(@“字体:%@”,[UIFont familyNames]);'? – jjv360

+0

什么版本的iOS? – trojanfoe

+0

@ jjv360 http://iosfonts.com/ – trojanfoe

回答

0

使用该代码的伴侣..

[alabel setFont:[UIFont fontWithName:@"American Typewriter-Bold" size:18]]; 
+0

除了不使用Objective-C-2.0风格的作业外,这与OP的代码有什么不同?哦,还有一个拼写错误的字体名称... – trojanfoe

+0

@trojanfoe是的队友确切所以我只是发布整行代码正确的队友? –

+0

你在说什么伴侣? – trojanfoe