如果用先new好的textview來放,就會一直失敗
internal func calculateTextSize(attributedText: NSAttributedString, maxWidth: CGFloat) -> CGSize {
var measureTextView = UITextView()
measureTextView.attributedText = attributedText
let size = measureTextView.sizeThatFits(CGSizeMake(maxWidth, CGFloat(FLT_MAX)))
return size
}
沒有留言:
張貼留言