动态输入文字 uitextView的frame动态改变
2015-10-08 15:04
405 查看
UITextView * text =[[UITextView alloc]initWithFrame:CGRectMake(0, 100, 200, 20)]; [self.view addSubview:text]; text.backgroundColor =[UIColor lightGrayColor]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ValueChange:) name:UITextViewTextDidChangeNotification object:nil]; // Do any additional setup after loading the view, typically from a nib. } - (void)ValueChange:(NSNotification *)obj { UITextView * textView = obj.object; CGRect rect = textView.frame; rect.size.height =textView.contentSize.height ; textView.frame = rect ; }
相关文章推荐
- ASINetworkQueue 队列下载
- UI最佳实践的N条建议
- Android GUI之View事件处理(二)
- PHP报错: Can't use method return value in write context
- UEditor
- hbase definitive guide 笔记
- Android GUI之View事件处理
- iOS中的动画:核心动画Core Animation, UIView动画, Block动画, UIImageView的帧动画.
- MUI - H5实现ios长按图标后进入图标排序及删除功能的效果
- UITableViewCell高度自适应Label高度
- 使用Anemometer基于pt-query-digest将MySQL慢查询可视化
- Codeforces Round #216 (Div. 2) E. Valera and Queries 树状数组 离线处理
- Android GUI之Window、WindowManager
- UI_动画-UIView属性动画、block块、仿设变换、CAAnimation
- UIGestureRecognizer手势
- POJ 2533 Longest Ordered Subsequence (LIS)
- 使用UINib加载xib文件实现UITableViewCell
- 1007. Maximum Subsequence Sum (25)
- SparkSQL05_prepareForExecution_01_EnsureRequirements
- 【转载】今天心情非常好,再发一组 Linq、 集合、数组、Lambda、QuerySyntax 的文章