Why is it cutting the sides off? It looks perfectly fine in storyboard. I set the size to 4.7 inch iPhone and applied the necessary constraints, but this happens.
Sounds silly, but make sure you have the correct resolution of splash screens set up. On certain phones I've noticed that the incorrect size would clip the screen to the size of the splash screen. Apple is your friend it just werks and all that.
So it's a duplicate of this Why [UIScreen mainScreen].bounds] is not returning full screen size?
Related
I have two storyboards, an iPhone and an iPad. Under the iPhone in the storyboard to UIScrollView is already connected UIImageView correctly, when running on the simulator, everything works correctly and xcode does not issue any warnings. And in the storyboard for ipad tried to connect the same UIIMageView to the UIScrollView, but it does not work out correctly and without prejudices.
For different devices, there are two different images with different size, for iPhones a picture with a size of 7+, and for the iPad, the picture size for 12.9. When you start the simulator 7+, the picture by height is displayed completely to the entire height of 7+, and the width is scaled to the right, the width of the picture is large. Accordingly, on smaller iPhones, when displaying a picture, in height it will take up more space than the height of the phone screen and will also scroll up / down + to the right. The same effect I try to achieve and for ipad. I tried to bind everything via reset to suggested, as well as just add the constants for UIImageView relative to UIScrollView, but still it does not work. Although I do everything the same way as I did for an iPhone. Please help. Thank's
My project https://yadi.sk/d/WU7tjwEv3NNRm6
enter image description here
I want have an image on my launch screen which occupies the same amount of the screen on different devices.
At the moment I have a logo which is about the right size on iPhone 4s, but on iPhone 6 Plus it's too small. Obviously these devices are in the same autolayout class.
I know I could use proportional sizing, but this will stretch the images and make them look fuzzy.
Also with it being a launch screen I can't use code for drawing or custom controls.
I guess I need some way to determine different devices in my constraints.
Add LaunchScreen asset group to your Assets. Then it will be possible to assign custom image for each screen resolution.
I really need help, I made an app I designed everything for iphone 7 I designed it with constraints and now I am having a problem because they don't look right on SE or 4s.
I am using circles made with IBDesignables(using cornerRadius to make circles). I want them when it resizes to stay circles because I tried couple of things and when it resizes its not a circle anymore.
Sorry for the long paragraph I just really need a tip !
How can I solve this problem
Here is how it looks on Iphone 7
Here is how it looks on Iphone SE
Here is how it looks on Iphone 4s
If you want to keep that all view stay circle for all device you must keep their height and width same.
You can easily do this thing with Autolayout set Aspect ratio of that view is 1 so their height and width remain same check screen shot
I am getting wrong screen size in iPhone 6 and 6+ by using
[UIScreen mainScreen].nativeBounds
and
[UIScreen mainScreen].bounds
In both case , i am getting wrong screen size.
So, I have added launch screen for iPhone 6 and iPhone 6+ then I get correct size of screen in iPhone 6 and iPhone 6+.
But another problem is that My App UI displaying wrong. All Screens of app left right padding. See below image :
If I remove launch screen for iPhone 6 and 6+ then App UI is displaying right as displaying before like below image :
In above image, no right padding.
I have also check by adding launch screen but that also getting wrong screen sizes.
Note : I have used AutoResize in app and It is working good in whole app.
I have also do so much googling to find out actual problem but unfortunately can't get it. Thanks so much in advance If anyone help to sort out that problem.
Sorry, did you check Settings -> Display and brightness -> View (Standart)?
One of the possible patch to identify your screen type is by getting the scale of your screen. You can use the following code : [UIScreen mainScreen].scale;
This will not let you know the exact screen size but will allow you to know what is the scaling. This method might be helpful where you need not to code individually for different screens and majorly do not want to convert your entire code to autolayout.
To know the scaling factor of different screens refer to following link : http://www.paintcodeapp.com/news/iphone-6-screens-demystified
I constructed the storyboard in the size class "compact width and regular height." when i run it in the iPhone 6 simulator, it looks fine and exactly as it does on the screen. but when i run the app on the iPhone 5 simulator, the images run off the screen. basically all the elements kept their exact size and did not scale down to the smaller screen size of the iPhone 5.
likewise, when run it in the iPhone 6plus simulator there is a lot of extra white space.
how can I fix this? is there an easy fix or do I have to remake all of the storyboards that I've done?
Since you are doing it with the IB you need to set aspect fill. Sometimes constraints will complain if you do this so only set ones that won't hurt you.