##1 属性 ###1. text(文本)ios
_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 (字体)app
// 设置字体名字和字体大小 _textView.font = [UIFont fontWithName:@"Arial" size:18.0];
###3. textColor (文本的颜色)字体
// 设置textview里面的字体颜色 _textView.textColor = [UIColor blackColor];
###4. textAlignment (排列方式)代理
// textView中的文本排列,默认靠左 _textView.textAlignment = NSTextAlignmentCenter;
###5. backgroundColor (背景颜色)code
// 设置浅灰色的背景色,默认为白色 _textView.backgroundColor = [UIColor grayColor];
###6. delegate(设置代理)htm
_textView.delegate = self; // 设置代理
###7. editable (是否可被输入)继承
_textView.editable = NO; // textView是否可被输入,默认为YES
###8. attributedText (默认插入textView的文字)文档
// 能够方便将文本插入到UITextView中。 _textView.attributedText = [[NSAttributedString alloc]initWithString:@"attributedText__-abc"];
###9. inputView (从底部弹出的视图)get
// 弹出视图,默认为键盘 _textView.inputView = [[UIDatePicker alloc]init];
###10. inputAccessoryView(设置弹出视图上方的辅助视图)
// 弹出视图上方的辅助视图 _textView.inputAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
###11. clearsOnInsertion 设置textView得到焦点,在用户使用虚拟键盘进行输入时,清除以前的文本
_textView.clearsOnInsertion = YES; // clearsOnInsertion,默认为NO