user3241188
user3241188

Reputation: 1

Disable editing in text view

I'm using Xcode coding an ios7 app, whenever I try to make a text view it is editable by the user. How can I fix this so it can not be editable? It is editable in the iPhone simulator, what property do I need to change to disable this and where can I find it?

Upvotes: 0

Views: 1048

Answers (3)

Grigo
Grigo

Reputation: 524

If you are using storyboard, click on UITextField in storyboard and there is a property called behaviour editable: remove the tick than and build.

Upvotes: 0

Janani M
Janani M

Reputation: 423

Try:

//.h

@interface YourViewController:UIViewController<UITextViewDelegate>
     @property (strong, nonatomic) IBOutlet UItextView *textView;
@end

//.m

 -(void) viewDidload
{
   _textView.delegate =self;
}

- (BOOL)textViewDidBeginEditing:(UITextField *)textField
{
   return NO;
}

Upvotes: 0

Lucas
Lucas

Reputation: 713

If you click on the textView in the storyboard (if you created it in the storyboard), then you can open the attributes inspector on the right and there is a checkbox that says editable. If it was not created in the storyboard, then there is a property

 textView.editable = NO;

Upvotes: 2

Related Questions