Can believe i am asking but: How do we full-justify text in a iOS UILabel in IB?

As per the title, this seems so trivial, i cannot believe it does not work. I have seen a few disparate pathways towards attempted solutions but none are something that seems like the correct way. All thoughts are welcome.
{edited title to explicitly point out full-justification is sought. As well, explicitly referring to IB}

I just tried this. Indeed UILabel text does not justify in IB when you set the alignment to justify. I didn't try, but does it also not justify the text when you actually run the app? If the text comes out justified when you run, I'd just report a bug and hopefully they'll fix it in an update.


Did you try setting the text to justify programmatically? Does that work? If that doesn't work I imagine it may be a bug in UIKit and not Interface Builder (i haven't tried this).


If UILabel does in fact justify when you do it in code, and you really want it to show up in IB, the only workaround I can think of is subclassing and using live rendering (justify the text in code..use live rendering, it 'should' show up).

Not great, but I can't think of another workaround.

Either way you should prolly file a bug.

Hey, thanks for trying! And no, there is no difference in runtime. Even the devtime preview shows the same end-result. The odd thing is: results vary with *occasionally* correct renderings. But mostly it looks like a messy bit of garbage. I hit this when as by QA to make an intro signup sequence have all the textual info (shown via UILabel) fully justified to make the screens look neater.


And i agree, i think the only current answer may be subclassing unless somebody else may know of a tweak or odd setting that might make it work.

To test an alternative i don't want to use, i programmically set one view's attributed text to NSTextAlignmentJustified and the results were entirely unsatisfactory. Perhaps Apple simple forgot to test this before shipping xcode?

It's called development for a reason, but yeah, it would be nice to see more reliable tools, none the less. Seems like they release things that they don't have much faith in where they may or may not worry about it later.

As a workaround, you can try using a UITextView instead of a label (turn editing and scrolling off).

Can believe i am asking but: How do we full-justify text in a iOS UILabel in IB?
 
 
Q