Xamarin Forms Label - Justify?

前端 未结 10 2082

I just wanted to ask if there is any way to justify text in a Label. I am using Xamarin Forms Xaml.

Thanks.

UPDATE:

10条回答
  •  甜味超标
    2020-12-07 02:10

    To Justify Text in UITableViewCell TextLabel - Xamarin IOS

    UIStringAttributes stringAttributes = new UIStringAttributes
    {
        ParagraphStyle = new NSMutableParagraphStyle() { Alignment = UITextAlignment.Justified }
    };
    
    var attributedText = new NSMutableAttributedString(cell.TextLabel.Text);
    attributedText.AddAttributes(stringAttributes, new NSRange(0, cell.TextLabel.Text.Length));
    cell.TextLabel.AttributedText = attributedText;
    

提交回复
热议问题