Justified Alignment in UITextView - iPhone

后端 未结 6 1493
名媛妹妹
名媛妹妹 2020-12-03 02:54

In my application, i have a UITextView with many lines, but I need the data with proper appearance.

Is it possible to have Justified Alignment in

6条回答
  •  借酒劲吻你
    2020-12-03 03:27

    For Right To Left Languages like Persian

        UITextPosition *beginning = textview.beginningOfDocument;
        UITextPosition *start = [textview positionFromPosition:beginning offset:0];
        UITextPosition *end = [textview positionFromPosition:start offset:[textview.text length]];
    
        UITextRange *textRange = [textview textRangeFromPosition:start toPosition:end];
        [textview setBaseWritingDirection:UITextWritingDirectionRightToLeft forRange:textRange];
    
        textview.textAlignment = NSTextAlignmentJustified;
    

提交回复
热议问题