更改UINavigationController中“后退”button的默认字体
我正在尝试将UINavigationController中的“后退”button的默认字体更改为自定义字体
UIFont *myCustomFont = [UIFont fontWithName:@"MyCustomFont" size:18];
我怎样才能设置这个自定义字体到后退button? 我已经浏览了其他类似问题的答案,但没有成功。
[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setTitleTextAttributes: @{UITextAttributeTextColor:[UIColor blackColor], UITextAttributeTextShadowOffset:[NSValue valueWithUIOffset:UIOffsetMake(0, 1)], UITextAttributeTextShadowColor:[UIColor whiteColor], UITextAttributeFont: myCustomFont } forState:UIControlStateNormal];