App not displaying properly on iphone6 - ios

I am having an issue with running my project on the device. Here are two pictures. The first one shows what the project looks like when I run it on the simulator. The second one is the same project run on the device:
As you can see in the first screenshot, I am using Auto Layout and Size classes. On the attributes Inspector I have the size set to iPhone 4.7-inch, but if I set to to "inferred" the same thing happens. I have done a fair bit of research on the web to see if I can find the solution but to no avail. I am fairly new so it could be something simple. Any help appreciated.
Update: I have set the size to inferred and turned off size classes and auto layout and I had resize all the buttons from 100 pixels to 80 pixels and now it looks fine on the device but I get the opposite problem on the simulator which was fine then. Is this an issue to do with iPhone 6 plus?
See next screenshot. On the left the storyboard and on the right the simulator.

Have you set attribute for it..? Because you are using size class.
Check it. If not set then set it for all objects.

Related

UIViews not displayed properly after disabling size classes

After trying a lot i am not able to figure out why my UIView is not being displayed same on different device. Initially i was using auto-layout and size classes but after having a lot of issues with it my senior told me to not use auto layout and disable size classes. So i did that but my view appears differently on 4s, 5s and 6s. This is how i placed all my elements in storyboard.
After i run the project on iPhone 4s it looks like.
On 5s (this is how it is supposed to look like on all devices):
On 6s (please ignore the screen dimmer effect):
Can someone please point out where am i going wrong. Thanks.
P.S: I was told to create a new project and start all over again, but the problem is i have already created some more view and there class file and i don't want to start all over again, also want to know what is causing this issue.
Go on use size classes and then disable it while disabling it you will get an option
Keep size classes for, Select iPhone and you are ready to go.

Views in storyboard do not resize properly on iPhone 6

I've checked a lot of different websites and stackoverflow answers, and I'm still stuck.
I developed an app for iPhone and iPad targeting iOS 7.1. I have two storyboards, one for each device. The app only displays in portrait mode. I cannot seem to get the app to display full screen on the iPhone 6 simulator.
I've tried numerous things, I followed the advice linked here by adding a Launch Screen, setting the iPhone storyboard to auto layout and "use size classes", and . Not only does that not affect the size, but the Launch Screen doesn't seem to scale properly either. If I get it to fit the iPhone 6 it doesn't fit the iPhone 5 properly.
I've tried adding the proper launch images and I don't get any errors saying the wrong image resolution is present.
I've used the storyboard as a Launch Screen described here.
Now, when I switched to "use size classes" I could manually extend the objects in the views to match up with the size of iPhone 6 (I have not tested it for 6s) but that makes it extend past the iPhone 5 boundaries. The only thing I can think of right now is to create another storyboard and detect if it's iPhone 6, but I would really like some other ideas.
Here's what it looks like for iPhone 6:
And here's what it looks like on iPhone 5:
Best advice i can give u is
Use default size class , the classic 600x600 and then use Auto Layout
Or do the reverse, take a 3.5inch size VC and apply Auto Layout on it. Everything will present itself quite perfectly if you can apply the right constraints
Here is a link for an awesome Autolayout tutorial

Auto Layout issue in XCode

So I've been working on an XCode Project for a while, it's practically done but there's a problem I didn't realize until it was too late. I'm working without Size Classes but with Auto Layout. I have a background image in the back and some buttons and labels over it. When I was setting the constraints for everything it all seemed to be in its place and I tested it various times in the same device size (iphone 5s) with the simulator. Now I decided to test it with the iPhone 6, and everything is wrong and not in the place I want it to be. How do I make labels/text fields/buttons keep the same size in ratio to the device?? How could I adapt things proportionally?? Please help.
I was getting the same issue , But after some R&D found useful solution .
Have a look into given link :Set view controller in ratio for iPhone-6 and 6+
Its very easy process and working for me .
I'm sorry for the bad explanations but I've found the way to do it. Here's the video that explained me how use constraints based on proportions and not on pixels.
https://www.youtube.com/watch?v=Gl6DibzPYa4
(The first 5 minutes is basically it)

Horizontal space constraint not working in iPhone 6 Plus only?

So I'm porting my app to adjust for various devices (iPhone 4/4S, iPhone 5/5S, iPhone 6/6P). My app only operates in portrait mode so the constraints and such should be very easy. I have been leveraging the new Xcode 6.2 tools such as the preview tool, and inferred view controller size, so I only have one storyboard for every device. However I have set up all the necessary constraints and the app runs and looks great on all the devices, excluding the iPhone 6P. But what confuses me is that the preview for the iPhone 6P looks exactly what I want, however when I run in the simulator its not correct. Please looks at the images below to understand the problem fully.
The desired look is this: (what it looks like running on all devices except iPhone 6P)
Now what it looks like on the iPhone 6P: (as you can see the tableview is shifted (on both sides) inward.
However as seen in the storyboard, the preview shows it correctly:
This is what the constraints look like in the storyboard:
Hopefully you can understand the problem by now and hope you can offer some help, thanks in advance, feel free to ask for clarification.
As you have confirmed in the comments the issue is that you are constraining to the view margin instead of the view directly.
To stop constraining to a margin for an existing constraint, select it and in the Size inspector uncheck the Relative to marginfor the items.
When creating a new constraint by dragging with control key, holding the alt (option) key while creating constraints will toggle the margin option.
If you are creating it with the popup menu in the lower rigth just uncheck the Constrains to margin

Anormal layout settings at iOS Simulator run time

Well, my problem it´s not code related. Almost all visual iOS Applications that i make at xCode got distortions at run time, for example I put a text input at the very center of the Mainboard and the simulator puts it way below than that at execution time. I would attached an image of an example regarding the problem, but I don´t have the reputation. What could the problem be? I´ve already uncheked NSLayout settings
You are creating your views for 4 inch screen and then run Simulator for 3,5 inch screen. No surprise that your positions are different. You should use Autolayout + constraints or UIView:autoresizingMask property to make your GUI change automaticaly for different screens.
Start with this article http://www.raywenderlich.com/50317/beginning-auto-layout-tutorial-in-ios-7-part-1

Resources