2016-02-23 26 views
0

其實這個問題已被多次回答,但我不知道我在哪裏查找。我試過這個。 in info.plist i have added museo700在ios中添加標籤中的字體

Then after i have added in bundle resources.

然後

- (void)viewDidLoad { 
    [super viewDidLoad]; 


    lbl_openHouse = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 120)]; 
    lbl_openHouse.textAlignment = NSTextAlignmentCenter; 

    lbl_openHouse.font = [UIFont fontWithName:@"Museo700-Regular" size:35]; 
} 

但不工作。 即使我已經嘗試過找到字體的實際名稱,但沒有在日誌中顯示。

for (NSString* family in [UIFont familyNames]) 
{ 
    NSLog(@"%@", family); 

    for (NSString* name in [UIFont fontNamesForFamilyName: family]) 
    { 
     NSLog(@" %@", name); 
    } 
} 

I have also edited. still not working

+0

我想,你缺少檢查這個[答案](http://stackoverflow.com/a/35454097/1603234),讓我知道它是否會幫助你。 – Hemang

+2

你的plist看起來不對。似乎該字體不是INSIDE數組「應用程序提供的字體」。箭頭已關閉,但仍顯示該值。 – Larme

+0

我編輯過,但仍然沒有工作.. –

回答

0

在你的plist你需要添加這樣

enter image description here

您沒有正確添加他們在你的plist。你的字體超出Fonts provided by the application

0

我從link下載了字體並安裝了它。它的實際名稱爲Museo700regular.ttf 我增加它的.plist象下面這樣:

enter image description here

在我的應用程序

它看起來像:

enter image description here

的原因可能與你實際的字體名稱。

+0

我已經安裝了所有前十名谷歌的答案,但仍然沒有得到..。 :-) –

+0

我認爲只有Museo700的問題,我已經嘗試了其他,都在工作.. –

相關問題