标签:http io os ar strong 文件 div art c
解决方式:
1.定义一个textview,在storyboard中设定该textview的constraints。
2.将高度的constraint定义到头文件里:(直接拖拽)
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *textviewHeightConstraint;3.待在实现文件里为textview载入了内容之后,获取文本高度,为该constraint赋值:
CGSize sizeThatShouldFitTheContent = [self.shippingAddressTextView sizeThatFits:self.shippingAddressTextView.frame.size]; self.textviewHeightConstraint.constant = sizeThatShouldFitTheContent.height;
參考链接:
http://stackoverflow.com/questions/50467/how-do-i-size-a-uitextview-to-its-content/2487402#2487402
标签:http io os ar strong 文件 div art c
原文地址:http://www.cnblogs.com/gcczhongduan/p/4009183.html