• iOS textView的使用总结


    转自:http://blog.csdn.net/zhaopenghhhhhh/article/details/11597887

     在.h文件中声明:

    @interface ProtocolViewController :UIViewController<UITextViewDelegate>

    {

        UITextView *textView;

    }


    @property (nonatomic,retain)UITextView *textView;


    @end

    在.m中初始化:

    self.textView=[[[UITextView alloc] initWithFrame:self.view.frame] autorelease]; //初始化大小并自动释放 
    self.textView.textColor = [UIColor blackColor];//设置textview里面的字体颜色 
    self.textView.font = [UIFont fontWithName:@"Arial"size:18.0];//设置字体名字和字体大小
    self.textView.delegate = self;//设置它的委托方法 
    self.textView.backgroundColor = [UIColor whiteColor];//设置它的背景颜色               
    self.textView.text = @"abcdefghi kjhk hkjhkjhksaejodslkae nfdkshekhfkdsae fdhskejhkfhskejh gfdhsgaejhgfjhdsgaejhgfjhdsgaejhgfdjsagejhgfhjsagejhgfdsjahgejhfgdsjha";//设置它显示的内容
    self.textView.returnKeyType = UIReturnKeyDefault;//返回键的类型
    self.textView.keyboardType = UIKeyboardTypeDefault;//键盘类型
    self.textView.scrollEnabled = YES;//是否可以拖动           
    self.textView.editable =NO;//禁止编辑
    self.textView.autoresizingMask = UIViewAutoresizingFlexibleHeight;//自适应高度           
    [self.view addSubview: self.textView];//加入到整个页面中
  • 相关阅读:
    oracle数据库导出与导入
    Mysql导入表信息[Err] 1067
    Golang--不定参数类型
    (转)Docker容器的重启策略及docker run的--restart选项详解
    (转)Golang--使用iota(常量计数器)
    Golang--匿名变量
    Golang--Hello World
    Ubuntu Server16.04 配置网卡
    U盘安装ubuntu 16.04 遇到 gfxboot.c32:not a COM32R image boot 的解决方法
    ipfs私链服务
  • 原文地址:https://www.cnblogs.com/feiyu-mdm/p/5565854.html
Copyright © 2020-2023  润新知