繁体   English   中英

设置navigationBar的titleTextAttriubutes仅会使应用程序在ios 7.1设备上崩溃而不是模拟器

[英]Setting titleTextAttriubutes of navigationBar crashes the app only on ios 7.1 device not simulator

这是使应用程序崩溃的代码

navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: NAV_BAR_TINT_COLOR]

这是输出

2014-08-13 18:21:47.567 demoapp[1214:60b] *** NSForwarding: warning: object 0x102e90000 of class '_TtCSs29_NativeDictionaryStorageOwner0000000156D27548' does not implement methodSignatureForSelector: -- trouble ahead
(lldb) 

这行代码曾经用于xcode 6 beta 4,我刚刚更新为xcode 6 beta 5,应用崩溃

你可以试试这个吗?

[[UINavigationBar appearance]setTitleTextAttributes:@{UITextAttributeTextColor : [UIColor whiteColor]}];
  This code work for me.May be it's helpful for you.

 let titleDict: NSDictionary = [NSForegroundColorAttributeName: UIColor.greenColor()]
 self.navigationController.navigationBar.titleTextAttributes =  titleDict
 self.navigationController.navigationBar.tintColor = UIColor.whiteColor()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM