我一直在打破这个问题,但出于某种原因,我看不到我在“.text”属性中设置的任何文字。以下是我的代码:
var container = NSTextContainer(size: CGSize(width: 300, height: 200))
var textView = UITextView(frame: CGRect(x: 60, y: 90, width: 300, height: 200), textContainer: container)
destinationViewController.view.addSubview(textView)
textView.backgroundColor = UIColor.blueColor()
textView.textColor = UIColor.whiteColor()
textView.text = "Testing"
textView.textAlignment = NSTextAlignment.Natural
textView.font = UIFont(name:"Times New Roman", size: UIFont.systemFontSize())
textView.delegate = self
在目标viewController加载后,backgroundColor可见,但文本不可见。我能做错什么?