我知道我可以单独更改导航栏的字体,如本答案所述:更改导航栏的字体 https://stackoverflow.com/questions/5832036/change-the-navigation-bars-font
目前我正在使用一种更全局的方法:
//in my app delegate:
[[UINavigationBar appearance] setBarStyle:UIBarStyleBlackTranslucent];
有没有办法通过外观对象全局更改导航栏的字体?
谢谢你!
来自雷·温德利希:
http://www.raywenderlich.com/4344/user-interface-customization-in-ios-5 http://www.raywenderlich.com/4344/user-interface-customization-in-ios-5
// Customize the title text for *all* UINavigationBars
[[UINavigationBar appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0],
UITextAttributeTextColor,
[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8],
UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0, -1)],
UITextAttributeTextShadowOffset,
[UIFont fontWithName:@"Arial-Bold" size:0.0],
UITextAttributeFont,
nil]];
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)