NSDictionary *dict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:
[UIColor colorWithRed:200 green:200 blue:200 alpha:1],
[UIFont boldSystemFontOfSize:20.0f],
[UIColor colorWithWhite:0.0 alpha:1],
nil]
forKeys:[NSArray arrayWithObjects:
UITextAttributeTextColor,
UITextAttributeFont,
UITextAttributeTextShadowColor,
nil]];
self.navigationController.navigationBar.titleTextAttributes=dict;
本文档展示了一个使用Objective-C设置UIKit属性的具体实例。通过创建一个NSDictionary对象,将UIColor和UIFont等UI元素作为值,UITextAttribute相关的常量作为键,以此来定义导航栏标题的文字属性。
6941

被折叠的 条评论
为什么被折叠?



