不工作,我需要將特定格式的導航標題設置文本attribue iOS中
我寫這篇文章的代碼
// color
UIColor *titlecolor = [self getUIColorObjectFromHexString:@"#5C8EB3" alpha:1.0];
[self.navigationController.navigationBar setTitleTextAttributes:
@{NSForegroundColorAttributeName:titlecolor}];
// font face
UIFont *font=[UIFont fontWithName:@"NotoKufiArabic-Regular" size:16.0f];
[self.navigationController.navigationBar setTitleTextAttributes:
@{NSFontAttributeName:font}];
是沒有問題的顏色,問題是與字體 任何人都可以請告訴我什麼是問題?
我收到以下異常:當我添加的字體的一部分,當我刪除字體部分它的工作原理 終止應用程序由於未捕獲的異常「NSInvalidArgumentException」,原因:「*** - [__ NSPlaceholderDictionary initWithObjects :forKeys:count:]:嘗試從對象[0]' –
插入nil對象後,使用列表字體的代碼,我發現字體名稱包含空間在字體列表中,當我使用它,因爲它是工作,謝謝 –
另外,如果您有多個目標,請確保您將字體添加到所有目標 –