// 设置它显示的内容
_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.";
// 设置字体名字和字体大小
_textView.font = [UIFont fontWithName:@"Arial" size:18.0];
// 设置textview里面的字体颜色
_textView.textColor = [UIColor blackColor];
// textView中的文本排列,默认靠左
_textView.textAlignment = NSTextAlignmentCenter;
// 设置浅灰色的背景色,默认为白色
_textView.backgroundColor = [UIColor grayColor];
// 设置代理
_textView.delegate = self;
// textView是否可被输入,默认为YES
_textView.editable = NO;
// 可以方便将文本插入到UITextView中。
_textView.attributedText = [[NSAttributedString alloc]initWithString:@"attributedText__-abc"];
// 弹出视图,默认为键盘
_textView.inputView = [[UIDatePicker alloc]init];
// 弹出视图上方的辅助视图
_textView.inputAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
// clearsOnInsertion,默认为NO,清除之前输入的文本
_textView.clearsOnInsertion = YES;
网友评论