[英]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.