Pros and Cons of Auto Layout [closed] - ios

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Yesterday, I have a problem with CGRectMake, which I already posted here: CGRectMake is not working with UIView
It is caused by having Auto Layout enabled in my project, so I have disabled it. Case closed...but today, when I run my project on the 3.5 inch simulator I have a new problem - all of my textfield, buttons, etc. seems like a mess.
Everything has no proper space between them, unlike when I had Auto Layout enabled. Here's what it looks like:
Is this the consequences of not enabling Auto Layout? If so, what should I do to make constant space between textfield, space of label to navbar, etc?

There is nothing i haven't been able to accomplish using autolayout. In my opinion if you don't use it you will go crazy.
I think the root of your problem is that in the question that suggested you disable autolayout it could have been fixed another way: Add any view manipulating code (resizing, etc) in viewDidLayoutSubviews in your view controller.

Related

Xcode: Storyboard change presentations [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Evening, I'm playing with Xcode storyboard and stack views inside a cell.
I have several stack nested.
When I load the app the presentation looks fine, but when I press into a row of the TableView, something happens and and Image view change the size :)
I'm sure that there is some kind of problem with constraints and stacks, but I can't find it, could you help me?
here's the git: https://github.com/AndreaMiotto/TwentyFour
Here some pictures:
Add fixes, not all, but it's working and you can fix rest by yourself.
https://github.com/OMGHaveFun/TwentyFour

Xcode Constraints is Difficult? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I've programed an app and am at the final stage (layout my design) i've tried setting the constraints
But am facing hard times with it ...
so
Is there a way to design a layout for each device (iphone 4,5,6) and ipads separately ?
if you want to design all of them separately then you'll have to go the nibs(.xibs) and make a different nib for each iphone(4,5,6) and ipads but rather than I suggest you to use size classes and and then apply the necessary constants at first it'll be a little difficult but by time you'll learn how to apply the size classes and constants.
Here are the links where you'll find the best examples.

Xcode - Swift arrange images in a grid 2x4 [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am developing a universal iOS app. I am looking to achieve the below grid layout using 8 images (inclusive of the text).
My skills of autolayout are poor, especially for universal apps. I would like the layout to remain for iPad and smaller screen devices, and scale the images accordingly.
I am unsure how to achieve this. Could you suggest a method and perhaps point me in the right direction by providing suggestions on methods to achieve this, such as UICollectionView or grid layout using autolayout.
Collection view! It's a great way to arrange things in a view like this that automatically adapts to screen size.
Apple docs - https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionView_class/
Simple example you can follow - How to make a simple collection view with Swift
UICollectionView is a powerful tool, can be tricky to nail down at first but follow along on the tutorial and you should be able to make your design in no time!

Constraints in Xcode (Swift 2 iOS App) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm making a simple iOS app in xcode using Swift and while I have the entire backend figured out (and it works perfectly), I don't understand constraints AT ALL. I'm trying to make my layout adaptive so it works on all iphone screens but I'm having a really difficult time. Any suggestions on how I can create the perfect layout? Resources would be helpful too. Most resources don't explain the concept or start from scratch.
Another issue I'm having is that every time I click on something, e.g. a table cell, and uncheck "Constrain to margins" and set the constraints, the changes aren't saved and as soon as I hit enter they revert back to the original settings.
REALLY lost on this whole constraints thing. Thanks!
So for learning constraints, I would advice you to do this tutorial. It is lengthy but it covers a lot of important concepts.
www.raywenderlich.com/115440/auto-layout-tutorial-in-ios-9-part-1-getting-started-2
As for constraint to margins, you need to deselect "constraint to margins" before you edit the values. And once you edit a value, make sure the red lines are activated, and do not click on add constraints until you are sure of all the values. (1)
(Image 1)
You can check and edit the constraint in this window, just select your view and go here (2)
(image 2)

Using Different Screen Sizes [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have an app made for a iPhone 5 screen and am having trouble making it so that it will look the same on a iPhone 4. I can't seem to figure out how to use both screen sizes without making 2 storyboards because there are about 35 views. Any answer that may help me fix this problem will be greatly appreciated.
Sincerely, Nick
~Beginner at IOS Development
Create the views more dynamic. For instance does a tableview fill up the extra space with rows. Autolayout can help increasing the distance between UIElements for this.
The old (iOS 6) way to disable iPhone 5 was not to submit the iPhone 5 Splashcreen. Afaik this "trick" isnt working anymore.
Best have a look on xcode 5. It can switch the storyboard from 4"to 3.5"on the fly and respects autolayout. Consider it as a great opportunity to get used to autolayout. (You will need it in the next gen of devices it seems)
Edit:
Make sure the top most view does resizing and this resize is passed down to your table/collectionview
If you use Autolayout then just pin the 4 borders of the collection view,
If you dont use autolayout, refer to picture 2 and make sure the autosizing behaves the same. Either way will work.

Resources