2012-11-27 26 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