美文网首页
iOS开发UITextView输出显示偏移问题?

iOS开发UITextView输出显示偏移问题?

作者: pengshuangta | 来源:发表于2017-11-30 14:28 被阅读83次

参考地址

1、有两种方式修改:

(1)self.automaticallyAdjustsScrollViewInsets = NO;(iOS7.0-11.0)

(2)self.infoTextView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;(iOS11.0-newer);

1、适配系统:(因为这两个属性在不同系统版本下,是需使用不同的设置的)

if (@available(iOS 11.0, *)) {

self.infoTextView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;

} else {

self.automaticallyAdjustsScrollViewInsets = NO;

}

相关文章

网友评论

      本文标题:iOS开发UITextView输出显示偏移问题?

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