wrong size on iOS when using scale
See original GitHub issuein the RNSharedElementTransition.m
line 638, we use the
CGRect ancestorLayout = [self.superview convertRect:endAncestor.style.layout fromView:nil];
code to get the end layout.
But in my case, one page’s width is 375, and I scaled it to fit other screens whose width is not 375 (eg iphone 11 Pro Max 414); And then the ancestorLayout
’s width will be 375, but not 414. This is not what I want.
I’m not good at iOS. So what should I do to fix this?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
iPhone 12 Wrong screen scale - Apple Community
I think that the screen scaling went wrong here. In my opinion the screen content of a 5.8" screen of an iPhone 11...
Read more >Screen scale/size is right in iOS 8 but wrong in iOS 9 on same ...
I've recently updated Xcode to 7 so I could start developing against iOS 9. Upon first launching my application, I noticed that the...
Read more >Resizing images to fit the screen using GeometryReader
To fix this we need to ask the image to resize itself proportionally, which can be done using the scaledToFit() and scaledToFill() modifiers....
Read more >FFImageLoading picking wrong image scale for app resources
FFImageLoading.Forms: Invalid height and width for images with no fixed size in iOS. Problem is occurring in the latest release: 2.1.0. In ...
Read more >How to scale a view based on device size using Auto Layout ...
Build the rest of the profile screen with the Intro to Auto Layout workshop: https://www.youtube.com/watch?v=_oMBJuzanws.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@IjzerenHein Hey, it’s me again. I solved my problem by doing the next change: https://github.com/IjzerenHein/react-native-shared-element/blob/edd7c5b32eac8197e736ae91b360d98de1edabaa/ios/RNSharedElementTransition.m#L269
to code
I know it’s not the right way to solve the problem, and maybe it will cause other errors. But it really runs in my case.
Although, I found my issue only occurs when I’m setting the navigation’s
cardStyleInterpolator
withSlideFromRightIOS
or any otherSlideFromXXX
. And my change only and only if runs withSlideFromRight
. It still has problem withSlideFromBottom
.So there are two ways to solve my problem, my change above and using something like
TransitionPresets.ScaleFromCenterAndroid
but notSlideFromXXX
.That’s all of what I do to solve this. I hope it will help if anyone has the same issue.
Sorry for bother you again.
It is a bad news for me. But anyway,thanks for your answer and this library.