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

2017-11-30  本文已影响83人  pengshuangta

参考地址

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;

}

上一篇下一篇

猜你喜欢

热点阅读