Any way to bottom-align UILabels with dissimilar fonts?

I have an array of UILabels inside the contentView of a custom UITableViewCell. The font of each label is sized by ranking to form a tag cloud. In the method that sets up the cell (row), I iterate through the word objects that will fit on that line, setting up the frame for each UILabel as follows:

CGRect theFrame = CGRectMake(xPosAdjuster,
    theWordRow.rowHeight - thisWord.lblHeight,
    thisWord.lblWidth,
    thisWord.lblHeight);
UILabel *myLabel = [[UILabel alloc] initWithFrame:theFrame];

This gets the frames of the labels aligned (see image below), but, unfortunately, the labels have a padding that is a function of the font size.

alt text

Is there any way to remove the padding (border) on a UILabel and/or calculate it exactly so I can adjust the y pos of the frames accordingly?

Thanks

8
задан Chris Hanson 28 December 2010 в 02:40
поделиться