zoukankan      html  css  js  c++  java
  • 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];//加入到整个页面中
  • 相关阅读:
    groovy脚本语言基础1
    014.Ansible Playbook Role 及调试
    013.Ansible Playbook include
    012.Ansible高级特性
    011.Ansible条件语句
    010.Ansible_palybook 循环语句
    009.Ansible模板管理 Jinja2
    008.Ansible文件管理模块
    007.Ansible变量Fact,魔法变量和lookup生成变量
    006.Ansible自定义变量
  • 原文地址:https://www.cnblogs.com/feiyu-mdm/p/5565854.html
Copyright © 2011-2022 走看看