iOS 7 - 导航栏项目文本颜色

标签 ios ios7 uipopovercontroller uinavigationitem presentmodalviewcontroller

我在 iOS7 上遇到导航栏项目的文本颜色问题。

在我展示一个 View Controller 之前,一切都很好,从那时起,所有导航栏项目的文本颜色都是灰色的。您对这个问题有任何经验吗?

用于呈现VC的代码:

[passcodePopover presentPopoverFromRect:CGRectMake([UIScreen mainScreen].bounds.size.width/2 ,currentWindow.frame.size.height/2,1,1)
                                     inView:currentWindow
                   permittedArrowDirections:0 animated:NO];[passcodePopover presentPopoverFromRect:CGRectMake([UIScreen mainScreen].bounds.size.width/2 ,currentWindow.frame.size.height/2,1,1)
                                     inView:currentWindow
                   permittedArrowDirections:0 animated:NO];

最佳答案

//call the below code in ViewDidLoad /It works fine in iOS7

UILabel *navLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,0, 320, 100)];
navLabel.backgroundColor = [UIColor clearColor];
navLabel.text = @"Event Details";
navLabel.textColor = [UIColor whiteColor];
navLabel.shadowOffset = CGSizeMake(0, -2);
[navLabel setFont:[UIFont boldSystemFontOfSize:16]];
navLabel.textAlignment = NSTextAlignmentCenter;
self.navigationItem.titleView = navLabel;

关于iOS 7 - 导航栏项目文本颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20736975/

相关文章:

ios - didSelectRowAtIndexPath 仅通过长按嵌入在容器 View 中的 tableView 调用

ios - Quickblox API 因无法识别的选择器而快速崩溃

ios - 选项卡栏 Controller 项目中 2 个 ViewController 之间的通信

ios - 为什么多点连接框架发现自己是一个外国同行以及不存在的外国同行?

ios - 使用自定义 iPad 弹出框将箭头与内容 View 对齐

ios - 如何显示另一个类的 UIPopover?

ios - Flurry 如何检测用户何时从提供的链接安装 iOS 应用程序?

iphone - 从 MDM 服务器验证配置字典

objective-c - 一个 View 中的两个 UIPopover

iphone - 添加到现有联系人