首页 > 代码库 > TextView设置成仅仅读

TextView设置成仅仅读

TextView设置成仅仅读


方法一:代理

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

方法二:设置属性

textView.editable = NO;
<script type="text/javascript"> $(function () { $(‘pre.prettyprint code‘).each(function () { var lines = $(this).text().split(‘\n‘).length; var $numbering = $(‘
    ‘).addClass(‘pre-numbering‘).hide(); $(this).addClass(‘has-numbering‘).parent().append($numbering); for (i = 1; i <= lines; i++) { $numbering.append($(‘
  • ‘).text(i)); }; $numbering.fadeIn(1700); }); }); </script>

TextView设置成仅仅读