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];//加入到整个页面中
  • 相关阅读:
    shell 编程小例子
    第二节,oracle sql编程以及高级
    第一节、oracle的安装及数据库和表的创建,知识整理
    PL/SQL-->UTL_FILE包的使用介绍
    显式游标和隐式游标的区别
    Oracle游标—for、loop、if结合应用
    oracle的用户自定义异常
    使用@property
    使用__slots__限制绑定属性
    给类,实例绑定属性和方法
  • 原文地址:https://www.cnblogs.com/feiyu-mdm/p/5565854.html
Copyright © 2011-2022 走看看