Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image placement #59

Open
Smiller193 opened this issue Feb 14, 2019 · 2 comments
Open

Image placement #59

Smiller193 opened this issue Feb 14, 2019 · 2 comments

Comments

@Smiller193
Copy link

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?

@IssaMansour
Copy link

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!

@slomkae
Copy link

slomkae commented Mar 25, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants