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];//加入到整个页面中
  • 相关阅读:
    python基础之流程控制
    多线程---阻塞队列
    多线程---线程同步
    多线程---线程实现
    多线程start();之后会开辟新的栈空间
    java中使用String的split分隔字符串注意事项
    IO流
    java中的多态
    关于java中的接口
    关于final关键字
  • 原文地址:https://www.cnblogs.com/feiyu-mdm/p/5565854.html
Copyright © 2011-2022 走看看