美文网首页
UITextView

UITextView

作者: 七维树 | 来源:发表于2018-06-06 18:21 被阅读8次

_textView = [[UITextView alloc] initWithFrame:(CGRectMake(0, 0, self.width - 2 * kNOMOLoginActiveViewPadding, 44))];
_textView.scrollEnabled = NO;
_textView.editable = NO;
_textView.selectable = NO;
_textView.showsVerticalScrollIndicator = NO;
_textView.showsHorizontalScrollIndicator = NO;

//两种方法设置内容紧贴边界
// _textView.contentInset = UIEdgeInsetsMake(0, -5, 0, -5);
_textView.textContainer.lineFragmentPadding = 0;
// 换行模式
_textView.textContainer.lineBreakMode = NSLineBreakByCharWrapping;
_textView.textContainerInset = UIEdgeInsetsZero;
_textView.contentMode = UIViewContentModeScaleToFill;
_textView.textAlignment = NSTextAlignmentLeft;

    if (IS_IOS11) {
        _textView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    }

相关文章

网友评论

      本文标题:UITextView

      本文链接:https://www.haomeiwen.com/subject/ookisftx.html