UITextView相关属性

•    text: 设置textView中文本
_textView.text = @"Now is the time for all good developers to come to serve their country.\n\nNow is the time for all good developers to come to serve their country."; // 设置它显示的内容
    •    font:设置textView中文字的字体
_textView.font = [UIFont fontWithName:@"Arial" size:18.0]; // 设置字体名字和字体大小

•    textColor:设置textView中文本的颜色
_textView.textColor = [UIColor blackColor]; // 设置textview里面的字体颜色

•    textAlignment:设置textView的文本的排列方式
_textView.textAlignment = NSTextAlignmentCenter; // textView中的文本排列,默认靠左

•    backgroundColor:设置textView的背景颜色
_textView.backgroundColor = [UIColor grayColor]; // 设置浅灰色的背景色,默认为白色

•    delegate:设置代理
_textView.delegate = self; // 设置代理

•    editable:设置textView是否可被输入
_textView.editable = NO; // textView是否可被输入,默认为YES

•    attributedText:设置默认插入textView的文字
_textView.attributedText = [[NSAttributedString alloc]initWithString:@"attributedText__-abc"]; // 可以方便将文本插入到UITextView中。

•    inputView:设置从底部弹出的视图
_textView.inputView = [[UIDatePicker alloc]init]; // 弹出视图,默认为键盘

•    inputAccessoryView:设置弹出视图上方的辅助视图
_textView.inputAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; // 弹出视图上方的辅助视图

•    clearsOnInsertion:设置textView获得焦点,在用户使用虚拟键盘进行输入时,清除之前的文本
_textView.clearsOnInsertion = YES; // clearsOnInsertion,默认为NO

IOS开发UI基础UITextView相关属性的更多相关文章

  1. IOS开发UI基础UITextFidle相关属性

    UITextFidle相关属性 •    enablesReturnKeyAutomatically默认为No,如果设置为Yes,文本框中没有输入任何字符的话,右下角的返回按钮是disabled的. ...

  2. IOS开发UI基础UIImagePickerController的属性

    UIImagePickerController 1.+(BOOL)isSourceTypeAvailable:(UIImagePickerControllerSourceType)sourceType ...

  3. IOS开发UI基础UITableView的属性

    UITableView UITableView内置了两种样式:UITableViewStylePlain,UITableViewStyleGrouped <UITableViewDataSour ...

  4. IOS开发UI基础 UIDatePicker的属性

    UIDatePicker        •    Locale设置DatePicker的地区,即设置DatePicker显示的语言.// 1.跟踪所有可用的地区,取出想要的地区    NSLog(@& ...

  5. IOS开发UI基础UIPageControl的属性

    UIPageControl 常见属性: •    numberOfPages // 设置有多少页 默认为0 [pageControl setNumberOfPages:kImageCount]; •  ...

  6. IOS开发UI基础UIPikerView的属性

    UIPikerView的属性 1. numberOfComponents:返回UIPickerView当前的列数NSInteger num = _pickerView.numberOfComponen ...

  7. IOS开发UI基础UIActivityIndicatorView的属性

    UIActivityIndicatorView 1.activityIndicatorViewStyle设置指示器的样式UIActivityIndicatorViewStyleWhiteLarge U ...

  8. IOS开发UI基础 UIAlertView的属性

    UIAlertView1.Title获取或设置UIAlertView上的标题. 2.Message获取或设置UIAlertView上的消息 UIAlertView *alertView = [[UIA ...

  9. iOS开发UI基础—手写控件,frame,center和bounds属性

    iOS开发UI基础—手写控件,frame,center和bounds属性 一.手写控件 1.手写控件的步骤 (1)使用相应的控件类创建控件对象 (2)设置该控件的各种属性 (3)添加控件到视图中 (4 ...

随机推荐

  1. linux web服务器必需的库文件

    往往安装完linux之后,本文用的centos6.4,再编译安装其它服务器软件时,总是提示缺少各种库文件,在这里我总结了一下 平时web服务器经常需要的一些库,如下: yum -y install m ...

  2. centos 开启启动服务优化

    默认开机启动服务列表:(此表转自 http://www.ha97.com/4815.html,另有多处补充) 服务名称 功能  默认   建议  备注说明 NetworkManager 用于自动连接网 ...

  3. LeetCode:Minimum Path Sum(网格最大路径和)

    题目链接 Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right ...

  4. pgpgin|pgpgout|pswpin|pswpout意义与差异

    引用来自: http://ssms.cs2c.com.cn/otrs/pc.pl?Action=PublicFAQZoom;ItemID=11741 文章主要意思是: 1. page in/out操作 ...

  5. Codeforces Round #379 (Div. 2) D. Anton and Chess 水题

    D. Anton and Chess 题目连接: http://codeforces.com/contest/734/problem/D Description Anton likes to play ...

  6. 2013年ACM湖南省赛总结

    今年的比赛最大的变化就是改用OJ判题了,相比于PC^2确实省事了不少,至少可以直接复制样例了.题目方面依旧是刘汝佳命题,这点还是相当好的,至少给人以足够的安全感. 开始比赛之后安叔瞬间就把前半部分题目 ...

  7. fresco Bitmap too large to be uploaded into a texture

    fresco加载图片方法 布局文件引入 xmlns:fresco="http://schemas.android.com/apk/res-auto" <com.faceboo ...

  8. WPF TextBlock 绑定 换行

    最近有个小需求 需要在textblock中换行 其实textblock换行有很多写法,比如: Xaml: <TextBlock Text="AAAAA BBBBB" /> ...

  9. Android杂谈--小知识点总结(1)

    此知识点总结是开发过程中遇到的比较棘手或者恶心的地方,所以随时更新,以备不时之需 1. viewFlipper中的item如何动态设置高度? 例如: <ViewFlipper android:l ...

  10. Windows Live Writer配置步骤

    推荐文档: [超详细教程]使用Windows Live Writer 2012和Office Word 2013 发布文章到博客园全面总结 Live Writer 使用小贴示:发博客时始终使用图片原始 ...