![](/img/trans.png)
[英]changing the MFMailComposeViewController navigationBar title font
[英]Set NavigationBar title Font
我一直在寻找一种方法来更改navigationBar中的标题字体,并且进行了以下尝试,但是没有任何反应,该字体在UILabel上工作正常,依此类推。
UINavigationBar.appearance().titleTextAttributes = [
NSFontAttributeName: UIFont(name: "SourceSansPro-Regular", size: 18) ?? UIFont.systemFontOfSize(18)
]
[[UINavigationBar appearance] setTitleTextAttributes:@{
UITextAttributeTextColor : [UIColor whiteColor],
UITextAttributeTextShadowColor : [UIColor blackColor],
UITextAttributeTextShadowOffset : [NSValue valueWithUIOffset:UIOffsetMake(1, 0)],
UITextAttributeFont : [UIFont fontWithName:@"System" size:25.0]
}];
迅速
UINavigationBar.appearance().titleTextAttributes = [UITextAttributeTextColor: UIColor.whiteColor(),
UITextAttributeTextShadowColor: UIColor.blackColor(),
UITextAttributeTextShadowOffset: NSValue(UIOffset: UIOffsetMake(1, 0)),
UITextAttributeFont: UIFont(name: "System", size: 25.0)]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.