UILabel automatic size and position
I want to draw a text with different colors and the only way that I've found for do it is to split every piece of string-color in differents UILabels, so currently now I have four UILabels one after another, lets say, label1, label2, label3 and label4.

The problem with that is with the size and the position of every labels, I've not found an automatic way for do it.

The only way is:

1. Set the text inside all the labels
2. Ask for the width of all the labels with this new text
3. Resize all the labels with this new width
4. Move label2 to label1.x + label1.width, and so on

This is really the only way in iPhone for do that?

I came from Android and there is a "wrap_content" property for every view and "relative_layouts" where you can define something like.. put label2 rightOf label1. So I'm looking of something simple and automatic like that, but in iPhone.

Thanks!

UILabel automatic size and position
===

I want to draw a text with different colors and the only way that I've found for do it is to split every piece of string-color in differents UILabels, so currently now I have four UILabels one after another, lets say, label1, label2, label3 and label4.

The problem with that is with the size and the position of every labels, I've not found an automatic way for do it.

The only way is:

1. Set the text inside all the labels
2. Ask for the width of all the labels with this new text
3. Resize all the labels with this new width
4. Move label2 to label1.x + label1.width, and so on

This is really the only way in iPhone for do that?

I came from Android and there is a "wrap_content" property for every view and "relative_layouts" where you can define something like.. put label2 rightOf label1. So I'm looking of something simple and automatic like that, but in iPhone.

Thanks!
