環(huán)境:xcode 11.2?
iPhone真機汤善,若低于iOS13.2的系統(tǒng)面哼,畢現(xiàn)歌殃;
產(chǎn)生原因:
xcode自身的BUG矾削,該bug已被Apple 員工證實壤玫。鏈接如下:https://forums.developer.apple.com/thread/125287#391939
解決辦法:
1豁护、回退Xcode版本到11.1哼凯,
2欲间、用代碼創(chuàng)建textView
3、在用xib創(chuàng)建時断部,添加如下代碼:
- (instancetype)initWithCoder:(NSCoder*)coder{
? ? if(@available(iOS13.2, *)) {
? ? ? ? return[superinitWithCoder:coder];
? ? }else{
? ? ? ? self = [super initWithFrame:CGRectZero textContainer:nil];
? ? ? ? self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
? ? ? ? self.contentMode = UIViewContentModeScaleToFill;
? ? ? ? self.scrollEnabled=false;
? ? ? ? self.translatesAutoresizingMaskIntoConstraints = false;
? ? ? ? self.font=***;
? ? ? ? self.textColor=***;//自定義顏色
? ? ? ? self.backgroundColor=***;
? ? ? ? return?self;
? ? }
}