tags:

views:

83

answers:

1

How can I add an indent or offset to text inside a UILabel? It needs to be a specific pixel size, independent of the font size.

+1  A: 

you could create another UILabel and then set each label's frames to be a certain width apart, that way it could be done dynamically rather easily if thats what you are trying to accomplish.

Jesse Naugher
well, my original desire was for adjusting the indent in a textLabel of a generic tableViewCell, so I cannot manipulate the frame of that label directly. I wanted to do that because I was also adding another view to the contentView of the cell and it would overlap the label otherwise. Ended up using a trick where a UIView can be converted to UIImage. So I set my custom view as an image to cell.imageView.image, which takes care of indentation.
SaltyNuts