Reputation: 123
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 =)
Upvotes: 1
Views: 1385
Reputation: 12107
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};
}
Upvotes: 2