Friday, 31 January 2014

Re: [NSCoderNightDC] Autolayout help

Yeah, auto-layout’s fun, once you get the hang of it. There are times you’ll want to tear out your hair while you’re trying to figure out how to get to get things to behave just how you want and there are some rough edges. Once you’re confident with it, it’ll greatly simplify layouts that previously would’ve driven you nuts - particularly anything where the layout’s content-driven. (Seriously, I think about the time I spent writing dynamic layout code pre-autolayout and I kind of want to cry.)

—Eric

On Jan 31, 2014, at 6:42 AM, Jon August <jonaugust@gmail.com> wrote:

Matt,

I can probably help if I make it out on Tuesday.  I have an app with some pretty crazy layouts.  Jose is right - Xcode 5 fixed everything.  Xcode 4 was a nightmare.

Just something that helped me quite a bit was selecting the views you want to set up constraints for in the Document Outline (the list of all the views on the left) and then applying the constraints using the Editor menu option at the top.  I almost never apply the constraints by clicking on the actual views or by using the icons on the bottom right - that seems to be a recipe for disaster.  

Also, getting things to move those last few pixels or correcting a <= to = should be done on the right in the size inspector for the constraint itself.  Also, if you’re getting orange lines, it means something is still ambiguous.  In those cases, make sure you’ve defined the width, x and y constraints.  A lot of times you can get away with not defining any constraints - just check that it works in multiple screen dimensions...

Also, don’t be afraid to delete all the constraints and start again.

If you give us some more detail on what’s giving you grief, maybe we can help more.

-Jon


On Jan 31, 2014, at 12:10 AM, Jose Vazquez <jose@teguz.com> wrote:

I've done a little Auto Layout in my own little iPhone projects but nothing serious (or even shipped.)  So far I've been able to figure my way through it, but I'm certainly no expert. To me really the turning point was Xcode 5, with Xcode 4 is was just ridiculous to even try. 

As for resources, I just watched the WWDC videos. Justin Williams gave a talk on Auto Layout during 360iDev Fall 2013. He has put together a little web page with pointers to his own presentation as well as other resources. You can find that at: http://carpeaqua.com/autolayout/

If you can make it to one of our meetings, I think you'll be able to find people  who can help you out a bit.

take care,
Jose


On Fri, Jan 31, 2014 at 12:02 AM, Matthew <matthew.bluedino@gmail.com> wrote:
Before I lose what little hair I have left on the top of my head, hopefully somebody can point me to some good articles, advice, etc about using Auto Layout.

Actually I have read a lot of stuff, some of it quite good. In addition to Apple's own docs, I've read a couple of blog posts by Jack Cox at CapTech, scoured Stack Overflow, read some related article on Double Encore's blog and more. I fell like I understand the theory behind Auto Layout. However, practically speaking, I've been trying to get something fairly simple to work for several hours and am making no progress.

So what articles have you read, videos that you've watched that have caused everything to click for you?

Thanks,

Matt


--
You received this message because you are subscribed to the Google Groups "NSCoderNightDC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nscodernightdc+unsubscribe@googlegroups.com.
To post to this group, send email to nscodernightdc@googlegroups.com.
Visit this group at http://groups.google.com/group/nscodernightdc.
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "NSCoderNightDC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nscodernightdc+unsubscribe@googlegroups.com.
To post to this group, send email to nscodernightdc@googlegroups.com.
Visit this group at http://groups.google.com/group/nscodernightdc.
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "NSCoderNightDC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nscodernightdc+unsubscribe@googlegroups.com.
To post to this group, send email to nscodernightdc@googlegroups.com.
Visit this group at http://groups.google.com/group/nscodernightdc.
For more options, visit https://groups.google.com/groups/opt_out.

0 comments:

Post a Comment