textView 自动调节高度
来源:互联网 发布:霜之哀伤淘宝 编辑:程序博客网 时间:2024/04/30 09:54
-(void)scrollViewDidScroll:(UIScrollView *)scrollView
{
BOOL b = YES;
static CGRect sframe;
if (b) {
sframe = scrollView.frame;
//CGRect sframe = scrollView.frame;
}
scrollView.frame = sframe;
if (self.startFrame.size.height<=scrollView.contentSize.height && self.contView.frame.size.height<250) {
CGSize size = scrollView.contentSize;
scrollView.contentSize = CGSizeMake(size.width, size.height);
CGRect tframe = self.textView.frame;
CGRect cframe = self.contView.frame;
self.textView.frame = CGRectMake(tframe.origin.x, tframe.origin.y, tframe.size.width, scrollView.contentSize.height);
self.contView.frame =CGRectMake(cframe.origin.x, cframe.origin.y, cframe.size.width, scrollView.contentSize.height+13);
}
}
#pragma mark textView 改变
-(void)textViewDidChange:(UITextView *)textView
{
static NSInteger preLength = 0;
NSInteger currentLength = textView.text.length;
if (textView.text.length == 0) {
self.viewPlaceH.text = @"请输入问题描述...";
}
else
{
self.viewPlaceH.text = @"";
if (preLength<=currentLength) {
preLength = currentLength;
}
else
{
preLength = currentLength;
[self scrollViewDidScroll:textView];
}
}
}
- textView 自动调节高度
- textview根据字数自动调高度,cell高度自动调节
- 自动调节高度
- Iframe框架自动调节高度
- Iframe高度随内容自动调节
- Iframe高度随内容自动调节
- 自动调节表格高度,强制换行
- 根据内容自动调节cell的高度
- 关于html中iframe自动调节高度
- textView根据字符数自动调整高度
- iOS-textView文本换行高度自动适应
- iOS-textView文本换行高度自动适应
- 用javascript 自动调节iframe高度出现问题
- div根据内容自动调节高度的解决方法
- JQuery插件第二十四个:自动调节iframe高度
- div根据内容自动调节高度的解决方法
- IOS学习-随着键盘高度变化自动调节界面内容
- IM模块--UItextView带有placeholder属性,自动调节高度
- eclipse中使用svn
- 需要注意的
- textView 退回键盘
- Android launch Mode
- Linux面试题汇总及答案
- textView 自动调节高度
- poj 3669 Meteor Shower
- acm1094
- UI基础-实现页面跳转和输入值的传递
- [leetcode]二叉树中序遍历
- 重修Android之新知识——layout_weight
- acm1095
- 史上最强php生成pdf文件,html转pdf文件方法
- Andorid login