默认情况下,iOS导航栏标题颜色似乎是白色.有没有办法将其改为不同的颜色?
我知道navigationItem.titleView使用图像的方法.由于我的设计技巧有限,而且我没有获得标准光面,我更喜欢更改文字颜色.
任何见解都会非常感激.
我正在尝试在工具栏中添加标签.按钮效果很好,但是当我添加标签对象时,它会崩溃.有任何想法吗?
UIBarButtonItem *setDateRangeButton = [[UIBarButtonItem alloc] initWithTitle:@"Set date range"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(setDateRangeClicked:)];
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, 20, 20)];
label.text = @"test";
[toolbar setItems:[NSArray arrayWithObjects:setDateRangeButton,label, nil]];
// Add the toolbar as a subview to the navigation controller.
[self.navigationController.view addSubview:toolbar];
// Reload the table view
[self.tableView reloadData];
Run Code Online (Sandbox Code Playgroud)