iOS scaled mode vs autolayout? - ios

I've developed several iOS apps but never used auto layout when dealing with screen larger than 4 inch (iPhone 6 and 6+). What I did is to enable scaled mode (by deleting launch xib and adding launch image) and only layout views in 4 inch. Since they have same aspect ratio this could work.
But I'm wondering is there any drawbacks of using scaled mode instead of auto layout, or is there any particular reason to use auto-layout?
Since I think auto layout just too much work to do and I just want all the screens have same UI (i.e. the larger the screen, the larger the view, instead of keep the view size constant but more gaps)

Auto Layout is the future. If Apple comes out with a new iPad that's much bigger, do you want your app to be "scaled", or take advantage of the whole screen? Users will give you better reviews and be happier if your app is not scaled.
Auto Layout really isn't too much work. It's more work not to implement it, and you shut yourself out from features like Adaptive UI, and having one code base that runs on all their devices, present or possibly future.

Related

How to efficiently use Autolayut and Auto-Resizing in same target?

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.)

Building responsive layouts with AutoLayout

For the past few months, I have been trying to learn iOS development. Most of it has relatively easy, however, one thing has been very difficult for me. AutoLayout. After I grasped constraints, I thought it would be easy, but I am having real trouble getting my layouts to look well on both iPhone and iPad devices. I can design pretty well for iOS. Recently, I was building an app where I put two buttons in the ViewController. on iPhone, I set the constraints of the buttons to equal the width of the screen (plus the screen margin), and set a reasonable looking height to the buttons. On iPhones, my layout looks great, but on iPads (especially the newest iPad Pro), things look horrific. Full width buttons look great on the iPhone, but on iPad they need to be a lot smaller width wise and a lot bigger height wise. Likewise, my images look great on iPhone, but are too small on iPads. In CSS, I could just use MediaQueries, and on Android, resource qualifiers on the values and layouts.
What are my choices here? How can I design my layouts to look nice on both iPhone and iPad when certain dimensions need to be different based on screen size, screen resolution, etc.? Constraints seem to be good for enforcing dimensions, but not adapting them.(Except maybe the Aspect Ratio constraint)
What features of the AutoLayout system can allow me to accomplish responsive layouts among larger screens and Retina resolutions? What are some common tips / tricks for developing responsive layouts.
You can use size classes in order to build for different screen sizes easily. raywenderlich.com has a solid guide on adaptive layouts.
You can use size classes to design differently for iPhones and iPads and also you can use proportional width height to look perfect based on the height ratio of all devices. If you want to choose first option then you can go with any tutorial available but if you want to choose the second option which is the little difficult way but time saving way then you need to really understand the sizes of devices and need to understand what actually proportional width and height constraints do. Thanks.

Resize UI to fit iphone 6/6+ without using auto-layout

I am building an ios app and I have been developing it on iphone 5 size class. I have done it this way because I have not yet learned how to use auto-layout. I was wondering if there was a way(other than auto-layout) that I can use, on this app so that the view fits perfectly in iphone 5/5c/5s and 6/6+
Without auto-layout the available solutions will be pretty rough. Because your lengths are all hard values-- you will have to manually manipulate them to achieve the size you want in an iPhone 6. It would definitely still be slightly more time consuming to apply auto-layout constraints onto all of your views-- but you would be safe from having to do this again in the future. Hopefully you don't have too many views :)

Auto layout or Autoresizing

I'm starting to develop an app that will only be on iPhone and only portrait view. I'm wondering the best way to develop an interface for both iPhone 3.5 inch and 4 inch screen. Every tutorial i see for auto layout seems to use it for portrait to landscape, but for me that doesn't matter because landscape isn't an option. I'm just wondering if I'm only using portrait is it easier to go with auto resizing?
Edit: I'll be using some UI animations in the project as well.
That depends on how your view sizes and positions relate to each other. If you want to align various views, or have views move when the text in a button or label moves then auto-layout is your friend. If you just want to resize a scroll view to fill the available space then auto-resizing is much simpler.
Arguably, learning auto-layout on a relatively simple app is a wise move to support your future app building endeavours...
If you want to make a relation between subviews and superview go for auto-resizing.
Otherwise if you want to make the relation between view or their neighbors view or adjacent view then go for auto layouts.
Auto Layout, because new features and functionality will be designed to work with Auto Layout, and your app will be more likely to be laid out correctly on upcoming devices or operating systems.
A case in point for iOS 8 is Adaptive UI. Apple has figured out and handled most of the edge cases, and content adapts to its view controller being collapsed or separated, remaining properly sized regardless of the device orientation or size. One code base. No conditional code required.
When Apple comes out with a new device or operating system, it's more likely that your app will behave more robustly if you use Auto Layout. If you size things yourself, you may overlook an edge case or not be prepared for a new size class, and your layout might break.
It comes down to how much code you want to write, support, and upgrade, versus letting the SDK figure out sizing, positioning, and relationships for you. Does their code have bugs? Yes. Does our code have bugs? Yes. Either way, it's not a perfect world. But anyone who adopted Auto Layout earlier, got a lot of functionality for free later. I believe adopting Auto Layout and size classes will continue to pay off, even at this stage.

iOS storyboard layout

I am working on an app and have come into some graphical problems when designing my app.
First off, my app is only support by iPhone. My current storyboard is using the iPhone 5 as the screen size, so everything screws up when I try to run in iPhone 4 and 4S. Is there a way to make multiple storyboards for each different screen size? Or do you all have another solution?
Thanks!
- Brad
There is a way to make different storyboards for separate screen sizes, but another way to do it is like this:
Whenever you add objects to your views, be sure to have them aligned to something (using constraints). If all items are relative to other items, then most likely the layout will be fine on all devices. Also, if you find that your controls start overlapping, then perhaps you ran out of room. In that case simply add a scroll view to your layout, and then put the controls on top of it. Then, it won't scroll on the larger screens because all controls are shown, but on smaller devices it will allow you to scroll down to see the rest of the objects.
Good luck.
There is a small button in the lower right hand corner that lets you toggle between 3.5" and 4" screen sizes so you can see how it will look on different devices. By using Auto Layout introduced in iOS 6 you can make sure to set up your constraints so that your UI looks good on both older and newer iPhones.

Resources