UINavigationBar 字体属性似乎只调整标题而不是视图的碎片部分
UINavigationBar Font properties only seems to adjust title but not breacrumbs portion of view
我在 AppDelegate.m 中使用了以下内容来更改 UINavigationBar 的字体属性:
[[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys:
[UIColor darkBlue], NSForegroundColorAttributeName,
[UIFont fontWithName:SYSTEM_FONT_TYPE size:SYSTEM_FONT_SIZE*1.2], NSFontAttributeName, nil]];
然而,这似乎只调整了 title-displaying 字体,而不是面包屑 back-tracing 部分:
查看 class 参考,我一定是遗漏了它,因为除了与 TitleTextAttributes 相关的那些之外,我没有看到任何其他可作为 属性 或方法参考的内容。我还应该更改什么来更改左侧文本的字体?
UIBarButtonItem *backbutton = [[UIBarButtonItem alloc] initWithTitle:@"Menu" style:UIBarButtonItemStyleBordered target:nil action:nil];
[backbutton setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor darkBlue],UITextAttributeTextColor,[UIFont fontWithName:TEXTFONT size:16.0f],UITextAttributeFont, nil] forState:UIControlStateNormal];
或者,
[[UIBarButtonItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor darkBlue],[UIFont fontWithName:TEXTFONT size:16.0f],UITextAttributeFont, nil] forState:UIControlStateNormal];
我在 AppDelegate.m 中使用了以下内容来更改 UINavigationBar 的字体属性:
[[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys:
[UIColor darkBlue], NSForegroundColorAttributeName,
[UIFont fontWithName:SYSTEM_FONT_TYPE size:SYSTEM_FONT_SIZE*1.2], NSFontAttributeName, nil]];
然而,这似乎只调整了 title-displaying 字体,而不是面包屑 back-tracing 部分:
查看 class 参考,我一定是遗漏了它,因为除了与 TitleTextAttributes 相关的那些之外,我没有看到任何其他可作为 属性 或方法参考的内容。我还应该更改什么来更改左侧文本的字体?
UIBarButtonItem *backbutton = [[UIBarButtonItem alloc] initWithTitle:@"Menu" style:UIBarButtonItemStyleBordered target:nil action:nil];
[backbutton setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor darkBlue],UITextAttributeTextColor,[UIFont fontWithName:TEXTFONT size:16.0f],UITextAttributeFont, nil] forState:UIControlStateNormal];
或者,
[[UIBarButtonItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor darkBlue],[UIFont fontWithName:TEXTFONT size:16.0f],UITextAttributeFont, nil] forState:UIControlStateNormal];