In meiner Anwendung habe ich eine UILabel und ich setzte einen attributedText auf es wie folgt aus:UILabel.attributedText zeigt nicht auf dem iPhone Simulator (wohl aber auf dem iPad Simulator)
let htmlString = try? NSMutableAttributedString(data: data, options: [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType, NSCharacterEncodingDocumentAttribute: String.Encoding.utf8.rawValue], documentAttributes: nil)
let characterCount = htmlString?.string.characters.count ?? 0
htmlString?.addAttributes([NSParagraphStyleAttributeName:paragraphStyle,NSBaselineOffsetAttributeName:0], range: NSMakeRange(0, characterCount))
self.chapterTextLabel.attributedText = htmlString
Wenn ich meine app starten Auf einem echten iPhone oder iPad Gerät oder in einem iPad Simulator funktioniert das großartig, aber wenn ich es auf einem iPhone Simulator (SE, 7 oder 7 Plus) starte, zeigt mein Etikett meinen Text nicht an.
Was ist wirklich lustig, wenn ich in den View-Debugger gehe, ist mein Text da!
Also, ist das ein Problem in meiner App oder ist es ein iPhone Simulator Problem?
Mögliche Duplikat [iOS 7 Simulator Bug - NSAttributedString nicht erscheint] (https://stackoverflow.com/questions/18994479/ios-7-simulator-bug-nsattributedstring-does-not-appear) – Himanth
Ich bin auf iOS 10 Simulator. Und dieses Problem ist nur auf iPhone Simulator (iOS 10), funktioniert gut auf iPad Simulator (iOS 10 zu) –
Welche Version genau? 10.3? Überprüfen Sie dies: https://stackoverflow.com/questions/43074652/ios-10-3-nsstrikethroughstyleattributename-is-not-rended-if-applied-to-a-sub – Larme