相关疑难解决方法(0)

iOS更改导航栏标题字体和颜色

所以我有这个代码应该更改导航栏标题字体,但它是doenst

    NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont
                                                                       fontWithName:_dataManager.optionsSettings.fontString size:14], NSFontAttributeName,
                            [UIColor whiteColor], NSForegroundColorAttributeName, nil];

[[UINavigationBar appearance] setTitleTextAttributes:attributes];
Run Code Online (Sandbox Code Playgroud)

使用此代码更改后退按钮字体可以正常工作.

   //set backbutton font
NSDictionary *normalAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
                                  [UIFont fontWithName:_dataManager.optionsSettings.fontString size:15], NSFontAttributeName,
                                  nil];
[[UIBarButtonItem appearance] setTitleTextAttributes:normalAttributes
                                            forState:UIControlStateNormal];
Run Code Online (Sandbox Code Playgroud)

fonts navigationbar ios ios7

99
推荐指数
6
解决办法
10万
查看次数

标签 统计

fonts ×1

ios ×1

ios7 ×1

navigationbar ×1