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

Why to override layoutSubviews method in SlideLeafCell #2

Closed
Stmol opened this issue Feb 25, 2018 · 2 comments
Closed

Why to override layoutSubviews method in SlideLeafCell #2

Stmol opened this issue Feb 25, 2018 · 2 comments

Comments

@Stmol
Copy link

Stmol commented Feb 25, 2018

open override func layoutSubviews() {

@horitaku46 in what case do you think we need to refresh subviews of the SlideLeafCell?

if let image = imageView.image {
       scrollView.setZoomScale(1, animated: false)
       calcImageViewFrame(image)
}

I found the case when it is called after double tap and the imageView inside SlideLeafCell is redrawn:
https://imgur.com/a/Ej3d4

In the video you can see that layoutSubviews() is called after I used setNeedsStatusBarAppearanceUpdate() and instead of to zoom, imageView is redrawn.

@horitaku46
Copy link
Owner

Hi! @Stmol .
Sorry for the late reply.
The reason why the following is described, if you zoom in on the image, rotate the iPhone and recalculate it, the display will collapse.

if let image = imageView.image {
       scrollView.setZoomScale(1, animated: false)
       calcImageViewFrame(image)
}

@Stmol
Copy link
Author

Stmol commented Mar 25, 2018

thank you very much 👍

@Stmol Stmol closed this as completed Mar 25, 2018
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

2 participants