Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making a UITextView not editable by the user

I made this UITextView and everything is perfect except the fact that when the user taps it, the keyboard opens up. How can I disable that "editing(?)" option?
Here's the code:

- (void)loadAboutStable {
UITextView *aboutStable = [[UITextView alloc] init];
[aboutStable setText:@"Please check Your network connection"];
[self addSubview:aboutStable];}
like image 769
Peter V Avatar asked Sep 06 '11 16:09

Peter V


2 Answers

[aboutStable setUserInteractionEnabled:NO] should do it

and if you still need scrolling:

aboutStable.editable = NO;
like image 149
James Webster Avatar answered Oct 11 '22 22:10

James Webster


aboutStable.editable = NO;

should work

like image 20
Jacob Avatar answered Oct 11 '22 20:10

Jacob