English 中文(简体)
采用何种方式使平等职业技能低下?
原标题: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];

这使贴上标签的框架(见下图),但不幸的是,贴上标签是按体大小发挥作用的。

“alt

是否有任何办法消除在统一分类标签制度上(边界)的婚礼和(或)准确计算,以便我能够相应地调整其范围。

增 编

最佳回答
问题回答

这里是我最后的贴上标签的法典:

CGRect theFrame = CGRectMake(xPosAdjuster,
    floor(theWordRow.rowHeight - thisWord.lblHeight),
    floor(thisWord.lblWidth),
    thisWord.lblHeight);
UILabel *myLabel = [[UILabel alloc] initWithFrame:theFrame];
...
CGRect newFrame = myLabel.frame;
newFrame.origin.y -= floor(myLabel.font.descender);
myLabel.frame = newFrame;

“alt





相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签