0
[[UINavigationBar appearance] setTitleTextAttributes:@{UITextAttributeTextColor: navTextColor,UITextAttributeTextShadowColor: navTextColor,UITextAttributeTextShadowOffset: [NSValue valueWithUIOffset:UIOffsetMake(0, 0)],UITextAttributeFont: [UIFont fontWithName:@"HelveticaNeue-Bold" size:12],UITextAttributeFont: [UIFont fontWithName:@"HelveticaNeue-Bold" size:12]}];
結果是文字較小。但是,它張貼得太高。
我可以修復使用
[[UINavigationBar appearance] setTitleVerticalPositionAdjustment:5 forBarMetrics:UIBarMetricsDefault];
但有時我想用UIText而非於titleview只是圖片和太下推。
這將是一個非常奇怪的設計,我認爲文本就像這樣上升。那麼有什麼問題,以及如何使UINavigationBar中的標題文本垂直居中,因爲它是水平的。