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

Preview doesn't fit the screen width #8

Open
appcornerit opened this issue Apr 15, 2019 · 8 comments
Open

Preview doesn't fit the screen width #8

appcornerit opened this issue Apr 15, 2019 · 8 comments

Comments

@appcornerit
Copy link

appcornerit commented Apr 15, 2019

it works well on simulator, on device the preview doesn't fit the screen width and it's anchored to the top, at least on my iPhone 7, iOS 11.0.2

@naturaln0va
Copy link
Owner

@appcornerit I'm looking into this now. I don't have a iPhone 7 with iOS 11 to test, but I'm downloading the 11.0 sim to see if I can reproduce. Are you having this issue with the example project, or a custom use case?

@appcornerit
Copy link
Author

I have the issue with the example project.
Has quick and dirty fix I replaced the constraints in viedDidAppear using snapkit in this way
preview!.snp.makeConstraints { (make) -> Void in
make.bottom.equalTo(superview.snp.top).offset(view.frame.origin.y-previewBottomMargin)
make.top.greaterThanOrEqualTo(superview)
make.left.equalTo(superview).offset(view.frame.origin.x)
make.right.equalTo(superview).offset(-view.frame.origin.x)
}
and it works, of course I don't like the workaround applied because of "view.frame.origin".

@naturaln0va
Copy link
Owner

What version of Xcode are you using? I tried to reproduce this on the iOS 11.0.1 simulator using Xcode 10.1 and it worked fine work me.

@appcornerit
Copy link
Author

I'm using Xcode 10.1 (10B61).
IMG_0043

@naturaln0va
Copy link
Owner

Sorry you're having this issue. Have you made any modifications to the project to get it into this broken state? Can you re-download/re-clone the project and try again?

Since I don't have a device to reproduce, I'm having a hard time figuring out what might be wrong.

@appcornerit
Copy link
Author

Hi, the screenshot was taken from my device using the sample project with no changes.
I also had hard time to find a workaround, any constraints referring to the view don't works, it's the reason why in my workaround I use the superview.
Thanks for your support, iOS 12 has more than 80% of distribution, it could be an iOS 11.0.2 issue that requires a specific workaround.

@mahesh-rideziro
Copy link

Not working in the notch device

@naturaln0va
Copy link
Owner

hello @mahesh-rideziro. What version of Xcode are you running and what version of iOS are you using?

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