Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone UITextView scrollable but not editable

How can I get a textview to be able to scroll without the keyboard poping up for edit when clicked on? I am pretty new to iPhone programming and I've tried several different combinations in Interface Builder, but can't seem to get any to work. Also I am having trouble when I have two textviews on the screen where only one of them will scroll. Any help would be greatly appreciated.Thanks!

like image 524
freaknroller Avatar asked Nov 28 '09 05:11

freaknroller


3 Answers

textView.editable=NO;

it is a property of UITextview, check the documentation

cheers

like image 141
YNK Avatar answered Sep 28 '22 05:09

YNK


In IB, next to the "Text Color" box, untick the 'Editable' checkbox.

like image 44
Finne Avatar answered Sep 28 '22 03:09

Finne


- (BOOL)textViewShouldBeginEditing:(UITextView *)textView{
    return NO;
}

try to implement this UITextView's delegate method.

like image 38
Morion Avatar answered Sep 28 '22 03:09

Morion