• 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
  • 相关阅读:
    c#redis使用
    不安全的HTTP方法(渗透实验)
    arguments.callee弃用与webuploader
    多线程系列1:经典卖票
    终于确定了系统lsass.exe占用cpu的根本原因了,速度来看一看!![转载]
    edit响应键盘的“咚咚”声音去掉
    delphi资源文件制作及使用详解
    MySQL server has gone away错误的解决办法
    MySQL server has gone away的解决方法
    MySQL
  • 原文地址:https://www.cnblogs.com/developer-wang/p/4520274.html
Copyright © 2020-2023  润新知