Component styling in react-native not rendering consistently within application - ios

When viewing my react-native application on an iphone 6 or 6s my some of my components render to the screen as different sizes, or are not visible or flicker between these states. See the following image of borderWidth: StyleSheet.hairlineWidth (taken as a screenshot off of my device)
What is the best approach for ensuring that my components' styling renders consistently in my iOS application?
UPDATE:
This issue does not only pertain to borderWidth... I was able to reproduce on my device with a View component, backgroundColor and height:1.
see basic example here: https://rnplay.org/apps/xUYNIQ (issue visible in emulator is the same issue I am having in my application on my iphone6)

This may be a precision loss render issue.
I have crashed into a problem like this.I wrote a function to transform styles for different devices, something strange happened : the bottomBorder become extra bold.
The PixelRatio get the device pixel ratio info, Dimensions get device width and height, but Dimensions.get('window').width * PixelRatio.get() doesn't equal to Apple Device data.
Before I use PixelRatio I change it to parseInt(PixelRatio).it won't make any problem,but on iPhone 6 and 6plus components will be smaller.

Related

Flutter/DART: Changing renderObject: RenderView size and display scaling issue

I have downloaded a demo app, which scales fine on my iPhone 12 pro max and fits the whole display. However, on the app I am developing, I cannot for the life of me get my app to scale the whole display.
Here is the a photo of my app which does not take up the full screen.
Here is the devtools window size:
And here is the devtools window size for the demo app, which scales perfectly and fills the whole display:
Notice that the window size is much larger on the demo app. How do I go about changing the size in my app? I tried fitting a constrainedBox, sizeBox, customScrollView but nothing works since it seems to be constrained by the renderObject.
I am new to Flutter, any help is much appreciated.

Unity Canvas scale issue on iOS

I've got a weird issue with Unity, where the height of the screen doesn't match the layout built in the editor, but only on iOS. It does work in the editor, in a Windows standalone and in the Android app, but not on iOS (im testing on an iPhone 5).
So the menu layout can be broken down to just a couple of full width images with different y-positions. These images are set to stretch in height, so no matter how I change the play-preview in the editor, they always fill the screen as intended.
As soon as I test it on the iPhone however, it looks like there was height added to the screen after calculating all the image heights or something. Every image seems to be about 10% too short.
This all did work some weeks ago, when I was on an older iOS version, xcode version and Unity version, but I updated them all in the meantime, so I can't say which one could be the cause for this.
Some weeks ago, the minimum iOS version in Unity was set to 7.0, now it has to be at least 8.0 to not get the "update project settings" warning in xcode.
The roughly 10% could be the iOS status bar, which could be taken into account for the height calculations, but then turned off and the game can span over the whole height.
The iOS "Resolution and Presentation" settings are set to require fullscreen and hide status bar.
Edit:
Here's what it looks like in the editor and on iOS.
The 4 different canvas have just different settings for the canvas scaler. The images in all of them have their RectTransform set to stretch in both directions.
It turned out to be caused by the generation of mipmaps.
I don't know why this is the cause and I don't know, why it's only a problem on iOS, but not on any other common platform, but once I used an image that had mipmaps disabled, it worked.
It then also worked on the original images, once I deactivated the mipmaps there.
I guess it has someting to do with the gradient images being 1x1920, so mipmaps make little sense. I'm wondering, why this is making the height buggy and not the width.

iOS Interface Oversized in Xcode Application

I have recently been running into a problem with one of the iOS applications that I'm developing. The problem with this application is that UI elements appear to be oversized. In Xcode the elements could have the same default sizes, but during the simulation process the elements are almost too large to fit on the screen. Has anyone ran into a similar issue and figured out how to resolve it. I have attached pictures below that illustrate the problem more clearly. In one of the pictures below, the keyboard clearly appears to be larger than that in the other picture.
Oversized User Interface
Normal Sized User Interface
Two possibilities
The device has Display Zoom turned on. You can change that in Settings > Display & Brightness > Display Zoom.
You app doesn't have a launch image for that size. Either add a launch image for that screen size or use a launch storyboard/xib. How to enable native resolution for apps on iPhone 6 and 6 Plus?

Resize app designed for Iphone 6 to scale correctly in iphone 5s

Ok, here is the problem I have designed an application for iphone 6 screen without size classes and autolayout.
Looking like below in the storyboard. As you can see its simulated size is 4.7 inch.
It works perfectly when running on iphone 6 devices obviusly.
However when trying to run the app in other devices than iphone 6 it wont scale proportional.
My hope was that if I removed the lanuch screen images only keeping the iphone 6 size it would scale to fit other screens looking the same as if it where run on a iphone 6 only scaled up or down depenging on device.
My launch screen looks like this now
It does infact scale the app but it scales the app in wrong proportion making it looked chopped like this.
Iphone 5s version of the app looks like this
As you can see it scales correctly but the aspect gets wrong compared to the iphone 6 version below scaling correctly.
Here is an ipad version looking like the iphone 5s version scaling wrong.
It seems to me that the scaling works since I have removed all launch images except the 4.7 display (iphone 6) The problem however seems to be that it scales keeping the aspect of an iphone 5 in width making the iphone 6 display to wide.
I have tried to add launch images for all devices but the problem then is that I need to use autolayout and size classes to make it work.
Is there any way to for instance tell the scaling to keep aspect but use iphone 6 width and height intact without using size classes etc.
To make the question even more simple. Is there any way to scale an app made for strictly iphone 6 so resize to iphone 5s/ipad?
Any help is highly appreciated!
Well, the "trick" with removing the other launch images doesn't work, as you noticed yourself.. This automatic scaling only works from 4" to 4.7" and 5.5" and is only to support older apps on the new devices, not for general purpose "I am too lazy to support all sizes" use cases.. ;-) Apart from that, you should definitely support the native resolutions.
So, to answer your question: You can either just use Auto Layout. This is definitely the preferred approach - after all that's exactly the use case that it has been built for.
Alternatively, if you really don't want to or can't use Auto Layout, you either need to make sure to set your auto resizing masks correctly (e.g. "flexible width" on the stuff that needs to grow/shrink horizontally etc.), or adapt your frames manually in code (which partially defeats the purpose of IB).
If you didn't use Auto-Layout or Size Classes, your only hope is to programmatically change the positions/size of each element individually in the viewDidAppear or viewDidLayoutSubviews method of your LoginViewController. You would have to do it also on orientation change (if your app supports it).
It's a lot of work that can be easily be avoided by using Auto-Layout/Size Classes!

What's the purpose in being able to resize a form for iOS?

When designing a form for a Firemonkey iOS application, you're able to resize the form into any possible size, and even the debug shows it as so. Obviously, iOS devices have very particular screen sizes. Why is it made possible to make my form in any dimensions I want?
I haven't gotten to the point of running this on any iOS device yet. This is my very first trial building an iOS HD application using Firemonkey. It's just very peculiar why it would let me design the form to any size I wish, since iOS apps are always full-screen and aligned to fit within various device screens.
Not all iOS devices run on the same resolution.
The iPhone 5 has a different aspect ratio than the iPhone 4.
And the iPad 3 has double the resolution of my iPhone 4.
You may also show a form covering only part of the screen (arguably more useful on an iPad).
Remember that FireMonkey is not written for iOS alone, it also covers OSX. In OSX you'd want all the normal VCL/Windows rules to apply.
Still I can see the sense if you're building a email application of having multiple screens (i.e. frames/panels/etc) performing different functions.
You can also imagine a pulldown/popup (modeless please) that does searching.
If you implement that using a different form it should not be full-screen.
So yes I can see lots of uses for non-fullscreen forms in iOS.
These two panels could be implemented using 2 forms; resizing would be useful here.

Resources