I have a custom UITableView cell that has a UIImageView sized to the width of the cell at the top, and a UILabel underneath it.
A UITableViewCell has an imageView property. If the image view’s image is set, then it pushes the cell textLabel to the right, to accomodate the image. I would like to do something similar with my table view cell (except that my label would be pushed down).
How could I accomplish this?
A simple way to do it is to subclass
UITableViewCelland overridelayoutSubviewsmethod.Here a simple example.
In particular inside this method you can position the components for your cell depending on
image.Hope it helps.