Ios 不可编辑的UITextView为字体返回零
我有一个Ios 不可编辑的UITextView为字体返回零,ios,swift,uitextview,Ios,Swift,Uitextview,我有一个UITextView,它将selective和editable设置为false: var myMutableString = NSMutableAttributedString() var myString:String = "hello kitty!" myMutableString = NSMutableAttributedString(string: myString) //some styling myTextView.attributedText = myMutableStr
UITextView
,它将selective
和editable
设置为false:
var myMutableString = NSMutableAttributedString()
var myString:String = "hello kitty!"
myMutableString = NSMutableAttributedString(string: myString)
//some styling
myTextView.attributedText = myMutableString
println(myTextView.font) //returns nil
您使用的是自定义字体吗?这可能是正确的,因为NSMutableAttributedString可以有多种字体?是的,我使用的是自定义字体。