Pet*_*r V 24 objective-c uitextview ios
我制作了这个UITextView,一切都很完美,除了当用户点击它时,键盘打开了.如何禁用"编辑(?)"选项?
这是代码:
- (void)loadAboutStable {
UITextView *aboutStable = [[UITextView alloc] init];
[aboutStable setText:@"Please check Your network connection"];
[self addSubview:aboutStable];}
Run Code Online (Sandbox Code Playgroud)
Jam*_*ter 67
[aboutStable setUserInteractionEnabled:NO] 应该这样做
如果你还需要滚动:
aboutStable.editable = NO;
Run Code Online (Sandbox Code Playgroud)
您也可以通过取消选中XIB来使用XIB进行操作,如以下屏幕所示:

并通过代码来完成:
textViewObject.editable = false
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
32001 次 |
| 最近记录: |