Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

arnieterm

macrumors regular
Original poster
Aug 28, 2008
201
0
Hi All,
I have a custom UITableViewCell with two UILabels [field-value] pairs. The value label needs to be multiline. Using the heightForRowAtIndexPath and cellForRowAtIndexpath of UITableView, I am able to resize both the cell and the respective UILabel to show complete text.
The problem is that in case of multiline label the text appears slightly dipped which results in both the labels [field and value pair] as not appearing in same horizontal line. I am making use of sizeWIthFont with constraint of NSString to determine the resultant height of the text and the function returns correct height.
But resizing the value label dips the text slightly [may be due to the adjustment of its center].
How can I prevent this?
Thanks
Arnieterm
 
By dipped I assume that you mean that the text in the two labels that are side by side doesn't line up exactly vertically.

Labels center their text vertically. So you need to adjust the height of the one-line label so its text aligns with the baseline of the multiline label. Basically if you make the height of the labels a little shorter the text will move up. This also depends on the size of the font you're using.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.