ImageRow
ImageRow copied to clipboard
Image placement
Hey there are certain cases where the image selected slides all the way over to the left for some odd reason. Anybody have any idea why?
Hello,
It's a little glitch in the example code.
You don't have to use this line (because x is equal to 0):
cell.accessoryView?.frame = CGRect(x: 0, y: 0, width: 34, height: 34)
but this line:
cell.accessoryView?.frame.size = CGSize(width: 34, height: 34)
Enjoy!
Hi! On the same note. I'm unable to center the row horizontally and vertically. I have tried the following code ` let img_size = CGFloat(110)
let bezel = CGFloat(10)
let cell_width = cell.frame.size.width
let x = (cell_width / 2) - (img_size / 2)
let frame = CGRect(x: x, y: bezel, width: img_size, height: img_size)
cell.accessoryView?.frame = frame
cell.accessoryView?.layer.cornerRadius = img_size / 2
cell.height = ({return (bezel + img_size + bezel)})`
When I put it in the cellSetup, it the size is correct but it sticks to the right And if I put this cellUpdate it is created on the right, but when i tap to change the image, it aligns correctly but still keeps bouncing from time to time.
Also, if the row is disabled, nothing I can do to make it center. Help much appreciated.
Elia