tags:

views:

1589

answers:

2

How do I get justified text with UTTextField. It does have an textAlignment property. But the UITextAlignment constant only has left, right, and center justification.

What I am seeking is the Justified text common in word processing app with text flush with both left and right edges. This is a read only text field.

I have seen it in few iPhone apps. So it seems I am missing something.

+2  A: 

It's a bit of an overkill maybe, but one way seems to be to use a WebView for it and style the text with CSS.

PEZ
A: 

UILabel and UITextField do not support full-justified text. If you want it for a UITextField, you would have to create a subclass of UITextField and override drawTextInRect:, splitting the text into words and using sizeWithFont: to figure out how to space them along each line.

I cannot imagine what would be worth the trouble.

benzado