[英]Setting titleTextAttriubutes of navigationBar crashes the app only on ios 7.1 device not simulator
Here is the code that crashes the app 这是使应用程序崩溃的代码
navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: NAV_BAR_TINT_COLOR]
This is the output 这是输出
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)
This line used to work with xcode 6 beta 4, I just updated to xcode 6 beta 5 and app crashes 这行代码曾经用于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.