-1
A
回答
2
0
您可以使用uinavigationbar的setTitleTextAttributes设置字体,颜色,偏移和阴影颜色。 这适用于ios 5.
0
CGRect frame = CGRectMake(0, 0, 200, 44);
TitleLabel = [[[UILabel alloc] initWithFrame:frame] autorelease];
TitleLabel.backgroundColor = [UIColor clearColor];
TitleLabel.font = [UIFont boldSystemFontOfSize:14.0];
TitleLabel.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.5];
TitleLabel.text = @"Nav Bar Title";
TitleLabel.textAlignment = UITextAlignmentCenter;
TitleLabel.textColor = [UIColor colorWithRed:1 green:2 blue:4 alpha:0.7];
self.navigationItem.titleView = TitleLabel.text;
You can take a UILabel, set its font, color alignment and add it on Navigation bar.
Hope it works for you.
相关问题
- 1. 导航栏,标题,通过代码
- 2. UIDocumentPickerViewController - 如何设置导航栏颜色
- 3. 设置导航栏的颜色
- 4. 从导航标题中设置状态栏颜色?
- 5. 导航栏颜色问题
- 6. iOS:导航栏标题 - 两种颜色
- 7. 如何设置正确的导航栏色调颜色?
- 8. 通过代码设置WPF中的GridView颜色通过代码
- 9. 如何设置默认的导航栏的颜色,文本颜色为所有视图控制器导航栏
- 10. 如何在UITableViewController的导航栏中设置editButtonItem的颜色?
- 11. 如何设置导航栏的字体颜色和大小
- 12. 如何设置底部导航栏选项相同的颜色?
- 13. 导航标题颜色
- 14. 设置一个的导航栏标题
- 15. 如何更改导航栏标题颜色?
- 16. 导航栏如何标题字体颜色字体样式
- 17. 如何为各个导航栏指定标题颜色? Swift
- 18. 如何将自定义(RGB)颜色设置为导航栏?
- 19. 从Swift 3代码更改导航栏的颜色和返回按钮标题
- 20. 设置工具栏的颜色和导航栏后退按钮
- 21. 当“prefersLargeTitles”设置为true时,更改导航栏标题的文本颜色
- 22. 导航栏的HTML颜色
- 23. 导航栏上的按钮着色颜色有时不设置
- 24. 的iOS:无法设置导航栏色调颜色
- 25. 如何使用Monotouch设置导航项目标题的代码?
- 26. 导航栏标题没有设置iphone
- 27. 抽屉式导航栏图标颜色
- 28. 设置导航栏/从应用(Android)内操作栏颜色
- 29. 在自定义导航栏中设置栏按钮项颜色
- 30. 黑色导航栏标题颜色可以更改吗?
您到目前为止尝试过什么?对于初学者,你有没有看过[UINavigationBar]的开发者文档(http://developer.apple.com/library/ios/#documentation/uikit/reference/UINavigationBar_Class/Reference/UINavigationBar.html)? – 2012-01-05 07:12:24