I've disabled size classes in my project and have 3 view controllers.
By looking at the preview of each of the view controllers, I've noticed that the iPhone 6 which is the one I've been running the application on shows a layout completely different than how it looks when you run it on the actual phone.
I'm trying to build an application with size classes disabled that will have an adaptive layout between iPhones. I was under the impression that size classes was geared towards adaptivity between iPhone and iPad applications?
My app looks good on the iPhone 6 and terrible on the 6 plus. I would like the layout to be adaptive between both iPhones. Any advice?
Thank you
PS: Using autolayout
First of all enable Size classes. This is how you can vary the changes for 6 and 6+. If you want the similar layout on both the devices then use 600x600 size. If you want different layout in 6 and 6+ then you have to switch the size class and change the constraints accordingly. Refer this link for tutorial: https://www.raywenderlich.com/113768/adaptive-layout-tutorial-in-ios-9-getting-started
Related
I have one target. It's a login based application. Because of legacy code, I am forced to use Auto-Resizing in some View Controllers whereas I have updated newer UI using Auto-Layout.
If the Autolayout has to work on iPhone 6 and 7 (4.7"/5.5" screens) I have to add the launch images for these.
PROBLEM:
All my screen that are not using auto layout gets disturbed when I add the Launch image.
If I don't use the launch screen images, all the View that use auto layout are scaled up and appears slightly bigger than expected.
I do not have the luxury to update the legacy code to use auto layout.
Can someone please give me an alternative or a work around.?
If I don't use the launch screen images, all the View that use auto layout are scaled up and appears slightly bigger than expected
Correct. This is because, without the launch screen, your app is no longer compatible with devices like the iPhone 6 and 6 Plus. To compensate, the app is treated as if this were an iPhone 5 and is shown in zoomed mode.
So if you want to run at native resolution / size on iPhone 6 and later, you must have the launch screen. That being so, setting up your interface to deal with the larger size is up to you. You do not have to adopt auto layout; autoresizing still works fine. (However, using auto layout would be better.)
I'm trying to create a iOS app, but I'm stuck on the layout.
I created the home view, but now I see that it's not shown in the right way in the 4S simulator.
I tried with size classes, but it looks like 4S and 6, for example, are in the same size class, and so I can't set a different dimension for views.
My goal is to support all devices, also iPads. Can someone please tell me how to do it?
Size classes mostly used for separation between ipad, apple watch and landscape modes.In potrait mode iphone 4 to iphone 6 all phone device sizes are in same class(regular height and compact width).Autolayout has many different constraints to help you to fit interfaces in same class.You should consider horizontaly/verticaly align, equal width and aspect ratio constraints.They are so flexible for smaller size changes and help you to design adaptive layout.
You should use "Reset to Suggested Constraints" for all views in your View controller. You can also check the simulated metrics for all devices without compiling the the code.
For 4s and 6 by default the size is Inferred. You should try resetting the constraints to check this for iPad as well.
I am just sharing an idea
Option1:
I think You can try adaptive Layouts and in file inspector->simulated Metrics->size-> Inferred. It works in all devices it supports both landscape and Portrait.
Option2: Go for Visual layouts they are easy to understand and they work perfect in all modes of Portrait.
I am think that you use code Instead design in main.storyboard !
for ex: create button with code
(and use Ratio in your code)
by this way i create small app for iPhone & iPad
!
My app has size classes disabled.
I've been testing throughout the entire development on my iPhone 6 and making sure that all objects are where they are supposed to be and up to my standard.
However, I recently ran it on an iPhone 6s and it seems like things are all over the place.
How do I build a responsive layout that molds itself to an iPhone 6s as well as an iPhone 6?
I've been using auto layout.
If your app is targeted for iOS 9 use stack views in combination with auto layout. It will allow you to create responsive layout quite easy. First you should check some tutorial about stack view in iOS if you are not familiar with it.
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
We all are going to update our apps to iphone 6 and iphone 6 plus. That means we need to support 4 sizes.
1.) 3.5
2.) 4
3.) 4.7
4.) 5.5
Can we support all these screen sizes with single xib or storyboard ? also please share your views on how we can update our existing apps for iphone 6 and iphone 6 plus.
Yes. See Apple's iOS8 documentation specifically, size classes:
iOS 8 makes dealing with screen size and orientation much more versatile. It is easier than ever to create a single interface for your app that works well on both iPad and iPhone, adjusting to orientation changes and different screen sizes as needed. Design apps with a common interface and then customize them for different size classes. Adapt your user interface to the strengths of each form factor. You no longer need to create a specific iPad storyboard; instead target the appropriate size classes and tune your interface for the best experience.
There are two types of size classes in iOS 8: regular and compact. A regular size class denotes either a large amount of screen space, such as on an iPad, or a commonly adopted paradigm that provides the illusion of a large amount of screen space, such as scrolling on an iPhone. Every device is defined by a size class, both vertically and horizontally.
There is also a very good tutorial video on the WWDC site.
In order to stop your iPhone 6/6+ app being scaled, add a launch image of the correct size or better, use a launch storyboard.
From there you should use AutoLayout and avoid hard coding to screen sizes. In the long run it'll be a lot less effort and less error prone.
In existing projects you can use autoresizing or auto layout of xib files.. that support all 4 devices.
I have implement my projects using autoresizing to support all devices.