Search code examples
iosuitextfieldtext-justify

is there any way to do JUSTIFY the text in a UITextView in iOS


Is there any way to 'justify' the text in a UITextView in an iOS app?


Solution

  • No that's not possible in a UITextView. There are two ways to achieve this.

    1. Write a method that adusts the text with spaces in a way that it fits the textview exactely
    2. Use CATextLayer. That class has a property to set the alignment to Justifiy.

    I hope this helps you out.

    Sandro Meier