开发者

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

does anybody know how to vertically align these text elements. I woul开发者_运维问答d like to define an absolute left padding for the text which is not affected by each image dimensions. It's quite annoying like this:

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

thanks a lot!


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜