項(xiàng)目中出現(xiàn)這個(gè)警告”Automatic Preferred Max Layout Width before iOS8.0”涝动。
出現(xiàn)這個(gè)問題一般是在項(xiàng)目的xib文件(或storyboard中),這是Label的一個(gè)屬性導(dǎo)致的. 這個(gè)警告對(duì)應(yīng)的屬性為preferredMaxLayoutWidth,這個(gè)屬性的作用如下:
This property affects the size of the label when layout constraints are applied to it. During layout, if the text extends beyond the width specified by this property, the additional text is flowed to one or more new lines, thereby increasing the height of the label.
對(duì)于單行的label,這個(gè)屬性不用設(shè)置,無效.(但是在xib中,當(dāng)項(xiàng)目部署版本為7.0的話,解決警告,依舊需要點(diǎn)選Explicit).如圖
出現(xiàn)這個(gè)警告的原因一般是因?yàn)轫?xiàng)目的部署版本為7.0,但是label又沒有勾選Explicit導(dǎo)致的,警告的意思即自動(dòng)偏好寬度在8.0以前不適用,因此對(duì)于部署在7.0的項(xiàng)目,應(yīng)該勾選.