![](/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.