VisualActivityViewController icon indicating copy to clipboard operation
VisualActivityViewController copied to clipboard

Preview doesn't fit the screen width

Open appcornerit opened this issue 6 years ago • 8 comments

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

appcornerit avatar Apr 15 '19 09:04 appcornerit

@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?

naturaln0va avatar Apr 16 '19 00:04 naturaln0va

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".

appcornerit avatar Apr 16 '19 07:04 appcornerit

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.

naturaln0va avatar Apr 16 '19 11:04 naturaln0va

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

appcornerit avatar Apr 16 '19 12:04 appcornerit

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.

naturaln0va avatar Apr 16 '19 13:04 naturaln0va

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.

appcornerit avatar Apr 16 '19 13:04 appcornerit

Not working in the notch device

mahesh-rideziro avatar Jun 30 '20 18:06 mahesh-rideziro

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

naturaln0va avatar Jul 01 '20 16:07 naturaln0va