user1179321
user1179321

Reputation: 801

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.

Upvotes: 0

Views: 162

Answers (3)

user4151918
user4151918

Reputation:

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.

Upvotes: 0

vikram rajpoot
vikram rajpoot

Reputation: 1

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.

Upvotes: 0

Wain
Wain

Reputation: 119031

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

Upvotes: 1

Related Questions