UITextView

 1 1.text:设置textView中文本
 2 _textView.text = @"Now is the time for all godd developers to come to serve their country ";//设置它显示的内容
 3 
 4 2.font:设置textView中文字的字体
 5 _textView.font =[UIFont fontWithName:@"Arial" size: 18.0];//设置字体名字和字体大小
 6 
 7 3.textColor:设置textView中文本的颜色
 8 _textView.textColor = [UIColor blacColor];//设置textView里面的字体颜色
 9 
10 4.textAlignment:设置textView的文本的排列方式
11 _textView.textAlignment = NSTextAlignmentCenter;//textView中的文本排列,默认靠左
12 
13 5.backgroudColor:设置textView的背景颜色
14 _textView.backgroudColor = [UIColor grayColor];//设置浅灰色的背景色,默认为白色
15 
16 6.delegate:设置代理
17 _textView.delegate = self;//设置代理 ,需要引入对应的协议
18 
19 7.editable:设置textView是否可被输入
20 _textView.editable = NO;//textView是否可被输入,默认为YES
21 
22 8.attributedText:设置默认插入textView的文字
23 _textView.attributedText = [[NSAttributedString alloc ] initWithString:@"attributedText_-abc"];//可以方便将文本插入到UITextView中
24 
25 9.inputView:设置从底部弹出的视图
26 _textView.inputView=[[UIDatePicker alloc]init];//弹出视图,默认为键盘
27 
28 10.inputAccessoryView:设置弹出视图上方的辅助视图
29 _textView.inputAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];//弹出视图上方的辅助视图
30 
31 11.clearsOnInsertion:设置textView获得焦点,在用户使用虚拟键盘进行输入时,清除之前的文本
32 _textView.clearsOnInsertion =YES;//clearsOnInsertion ,默认为NO

 

posted @ 2015-05-21 17:20  王世桢  阅读(198)  评论(0编辑  收藏  举报