Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I align static "Right Detail" UITableViewCell contents with images properly?

I am using the storyboard, static cells and the "Right Detail" cell style. My issue looks like the following in both Xcode and simulator (red lines added for guidance):

enter image description here

As you can see, the third row is off. It is shifted to the right by 1 point. Both image and label are misaligned. All images have a width of 24px and the size inspector shows this correctly. Attributes inspector settings for all three cells are identical, except the image.

What's wrong? Thanks!

like image 687
ericteubert Avatar asked Nov 22 '25 11:11

ericteubert


1 Answers

Seems like the most likely explanation is that your "X" graphic isn't centered correctly.

If you've checked that it is correctly centered in photoshop, is it possible that the version you've checked and the one you are seeing in the app are different images (e.g. because one is a the @2x retina version)?

A good test might be to fill the background of the image with a colour (e.g. red) so you can see the image boundary and prove for certain that the image itself is misaligned, not the image contents.

like image 143
Nick Lockwood Avatar answered Nov 24 '25 02:11

Nick Lockwood