开发者

iPhone UITextView scrollable but not editable

开发者 https://www.devze.com 2022-12-13 04:44 出处:网络
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

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. Al开发者_Python百科so 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!


textView.editable=NO;

it is a property of UITextview, check the documentation

cheers


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


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

try to implement this UITextView's delegate method.

0

精彩评论

暂无评论...
验证码 换一张
取 消