UITextView
2015-08-28 17:33
375 查看
UITextView
1. text: 设置textView中文本
_textView.text = @"Now is the time for all good developers to come to serve their country.\n\nNow is the time for all good developers to come to serve their country."; // 设置它显示的内容2. font:设置textView中文字的字体
_textView.font = [UIFont fontWithName:@"Arial" size:18.0]; // 设置字体名字和字体大小3. textColor:设置textView中文本的颜色
_textView.textColor = [UIColor blackColor]; // 设置textview里面的字体颜色4. textAlignment:设置textView的文本的排列方式
_textView.textAlignment = NSTextAlignmentCenter; // textView中的文本排列,默认靠左5. backgroundColor:设置textView的背景颜色
_textView.backgroundColor = [UIColor grayColor]; // 设置浅灰色的背景色,默认为白色6. delegate:设置代理
_textView.delegate = self; // 设置代理7. editable:设置textView是否可被输入
_textView.editable = NO; // textView是否可被输入,默认为YES8. attributedText:设置默认插入textView的文字
_textView.attributedText = [[NSAttributedString alloc]initWithString:@"attributedText__-abc"]; // 可以方便将文本插入到UITextView中。9. inputView:设置从底部弹出的视图
_textView.inputView = [[UIDatePicker alloc]init]; // 弹出视图,默认为键盘10. inputAccessoryView:设置弹出视图上方的辅助视图
_textView.inputAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; // 弹出视图上方的辅助视图11. clearsOnInsertion:设置textView获得焦点,在用户使用虚拟键盘进行输入时,清除之前的文本
_textView.clearsOnInsertion = YES; // clearsOnInsertion,默认为NO相关文章推荐
- UIView的layoutSubviews和drawRect方法何时调用
- UIPageControl
- UIPikerView
- UITableView上拉时崩溃问题及解决
- builder.properties
- UUID.randomUUID()
- UIAlertView基本用法详解和delegate方法调用
- easyUI的列表控件(datagrid)日期列不能正确显示的解决方法
- Django中的request和response
- UIScrollView
- java.lang.SecurityException: Requires VIBRATE permission
- iPhone开发之UIScrollView滚动组件的使用(四) 拖线实现 喜马拉雅案例
- POJ 2031 Building a Space Station
- java.lang.SecurityException: !@Too many alarms (500) registered from pid 10790 uid 10206
- 最火的UI快速开发框架androidannotations
- Ansj标准分词使用注意事项(MyStaticValue.isRealName属性)
- 【Material Design视觉设计语言】UI组件设计(十五):文本框
- uva 1152 4 Values whose Sum is 0(二分_中途相遇|| hash)
- Android UI 绘制过程浅析(四)draw过程
- SQLQuery