?YYTextLayout * layout =【yytextlayoutoutwithcontainersize:CGSizeMake(self . msg label . width,CGFLOAT _ MAX)text:notice tr】;
self . msg label . text layout = layout;
計算的寬度和顯示的寬度必須壹致。
2.在將noticeStr分配給布局之前設置breakmode,否則它將默認為word。