Hello,
My imageView that I have set in my custom table view cell moves the set image to a different place on run time.
The thing that confuses me is that if I manually set the image in the attributes inspector the image is in the place it is supposed to be. Only when setting the image programatically does this problem arise.
Below is the code I am using my cell creation function to generate the tick or cross.
// Cell Information
if answersBool[indexPath.row] == false {
cell.imageView!.image = UIImage(named: "crossIcon.png")
} else {
cell.imageView!.image = UIImage(named: "tickIcon.png")
}
This is what happens on run time.
This is what the cell looks like in my storyboard.
First of all remove all constraint from your imageView after that select your imageView and click on pin menu then add this five constraint shown in below Image:
Hope it will help you.