2016-08-04 5 views
0

私の次のコードは、下側にUILabel単語文字カットのテキストを修正する方法

NSMutableParagraphStyle *body1stParagraph = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; 

     body1stParagraph.alignment = NSTextAlignmentCenter; 
     body1stParagraph.minimumLineHeight = _font_Size; 
     attrs = @{ NSFontAttributeName : [UIFont fontWithName:font_name size:Font_size], 
        NSParagraphStyleAttributeName : body1stParagraph, 
        NSAttachmentAttributeName: textAttachment}; 

であり、この辞書は、属性付き文字列

[attributeString addAttributes:attrs range:lineRange]; 

の追加が、ラベルのテキストは

をカットされます enter image description here

+0

ラベルにconstraintを使用しましたか? –

+0

いいえ、iラベルプログラムで@vishalを追加 – Keyur

+1

ラベルのフレームを変更します。ラベルの高さでは、複数行のテキストを格納するには十分ではありません。 –

答えて

0

これで問題が解決する場合があります。

yourLabel.sizeToFit() 
+0

私はすでにラベルsizeToFitを与えていますが、ラベル@Anupamは動作しません – Keyur

関連する問題