开发者

Customising UITableViewCell with many UILabels

Basically, I want to have four labels on my contentview. I customised the UITableViewCell in IB, with my own custom class. I wanted the labels to be stacked one after another.

However the labels seems to be on top of the others, which makes the other labels not visible. I have the following configuration:

title.textAlignment = UITextAlignmentLeft;
title.lineBreakMode = UILineBreakModeWordWrap;
title.num开发者_开发百科berOfLines = 0;

Customising UITableViewCell with many UILabels

For all of my labels. I also made sure I have the correct height in heightForRowAtIndexPath delegate method (which is just adding the height of all the labels). I'm not sure where I went wrong... Can anyone help me?

EDIT: Picture of the UITableViewCell for those who are interested:

Customising UITableViewCell with many UILabels


It seems problem of autoresizing. Did you try to set autoresizing for all the labels? Also the picture you have posted in the question in that picture origin anchor I can see in center while it should be in top left corner.


Can you please check by changing this:

title.numberOfLines = 1;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜