tags:

views:

610

answers:

1

I am trying to display two labels on UITableViewCell, one with left-aligned text and another with right-aligned text. The cell with right-alignment of text is cut on the right by 1-2 pixels. I tried increasing the width of the UILabel but it does not make a difference.

The text appear fine in the simulator but on the device it gets cut towards the right.

Here's the image URL for reference (Long Text 3 is cut)

A: 

This can be overcome by using the autoResizingMask property of the UILabel with right alignment.

label.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleHeight;

Hope that helps someone.

lostInTransit