开发者

ImageView vertical alignment - UITableViewCell

Here is my issue:

I have an UITableViewCell with more than 1 line in the content (the text is very long).

The vertical alignment of the ImageView (I put an image in the left side of the cell) is in the centre (I guess this is by default), but I want to see this image in the top.

开发者_运维百科

Do you have any idea of how can I modify its vertical alignment?

Any reply will be much appreciated.

Thanks =)


I've subclasses UITableViewCell, and added this, which bumps it up to 10px below the top of the cell.

- (void)layoutSubviews {
    [super layoutSubviews];
    self.imageView.frame = (CGRect){.origin.x = (60-self.imageView.frame.size.width)/2, .origin.y = 10, .size = self.imageView.frame.size};

}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜