objective-c – UITextView:如何真正禁用编辑?
栏目: Objective-C · 发布时间: 6年前
内容简介:翻译自:https://stackoverflow.com/questions/10067853/uitextview-how-to-really-disable-editing
我想要做的是让我的UITextView不可编辑.我试过[aboutStable setUserInteractionEnabled:NO];方法,但它会导致页面无法访问.
这是当前的代码.
- (void)loadTextView1 { UITextView *textView1 = [[UITextView alloc] init]; [textView1 setFont:[UIFont fontWithName:@"Helvetica" size:14]]; [textView1 setText:@"Example of editable UITextView"]; [textView1 setTextColor:[UIColor blackColor]]; [textView1 setBackgroundColor:[UIColor clearColor]]; [textView1 setTextAlignment:UITextAlignmentLeft]; [textView1 setFrame:CGRectMake(15, 29, 290, 288)]; [self addSubview:textView1]; [textView1 release]; }
任何建议/答案都表示赞赏.
- (void)loadTextView1 { UITextView *textView1 = [[UITextView alloc] init]; textView1.text = @"Example of non-editable UITextView"; textView1.backgroundColor = [UIColor clearColor]; textView1.frame = CGRectMake(15, 29, 290, 288); textView1.editable = NO; [self addSubView:textView1]; [textView1 release]; }
翻译自:https://stackoverflow.com/questions/10067853/uitextview-how-to-really-disable-editing
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- 如何临时或永久地禁用SELinux
- iphone – 移动CALayers时禁用动画
- 当浏览器全面禁用三方 Cookie
- Bootstrap禁用响应式布局的实现方法
- 如何绕过PHP中被禁用的函数
- php – 禁用表单元素的POST值
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Geometric Folding Algorithms
Erik D Demaine / Cambridge University Press / 2008-8-21 / GBP 35.99
Did you know that any straight-line drawing on paper can be folded so that the complete drawing can be cut out with one straight scissors cut? That there is a planar linkage that can trace out any alg......一起来看看 《Geometric Folding Algorithms》 这本书的介绍吧!
HTML 压缩/解压工具
在线压缩/解压 HTML 代码
随机密码生成器
多种字符组合密码