Claus
Claus

Reputation: 5722

iPhone TableView: defining padding between images and text in a cell

does anybody know how to vertically align these text elements. I would like to define an absolute left padding for the text which is not affected by each image dimensions. It's quite annoying like this:

enter image description here

thanks a lot!

Upvotes: 0

Views: 305

Answers (2)

fernholz
fernholz

Reputation: 25

You could do it by slecifying the frame on your UIImage, UILabel, or both. Set the float x to a safe distance from the left on the label or specify the width of your widest image as the width of the UIImage frame.

I can clarify more if needed when I'm not on my mobile.

Upvotes: 0

coneybeare
coneybeare

Reputation: 33101

You have two options.

1) UITableViewCell has a textLabel property which you can access and adjust the frame. See the Apple docs for more info on UITableViewCell

2) You can ensure that all of your icons have the same width.

Upvotes: 1

Related Questions