//自动调节输入文本框的高度- (void)textViewDidChange:(UITableView *)textView{ float height; if ([[[UIDevice currentDevice] systemVersion] f ...
//自动调节输入文本框的高度
- (void)textViewDidChange:(UITableView *)textView{
float height;
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
CGRect textFrame = [[self.textView layoutManager] usedRectForTextContainer:[self.textView textContainer]];
height = textFrame.size.height;
}
else{
height = self.textView.contentSize.height;
}
self.textView.frame = CGRectMake(self.textView.frame.origin.x, self.textView.frame.origin.y, self.textView.frame.size.width, height);
}
原标题:iOS之自动调节输入文本框的高度
关键词:IOS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。