Hacker News new | past | comments | ask | show | jobs | submit login

I find this layout model annoying to work with. Everything is like a loaded spring, and if you forget one constraint, it may rip the whole layout into 0-sized pieces.

This model can't express wrapping, so it can't gracefully scale layouts down from desktop to mobile sizes (when you have a 3-column layout you have lots of control over column widths, but no way of turning them into 3 rows instead).

CSS Grid and Flexbox are pretty good. Conceptually they're messier than mathematically-beautiful constraints, but in practice they're more powerful and more robust.




> so it can't gracefully scale layouts down from desktop to mobile sizes (when you have a 3-column layout you have lots of control over column widths, but no way of turning them into 3 rows instead).

On Apple platforms (UIKit on iOS) handling such layout changes is done with another mechanism on top of auto layout. Something they call "Size Classes". You get a callback saying eg. "view has changed to Regular width, Compact height" and you switch to a another set of auto-layout constraints + animate as desired. This size class system is used for stuff like handling rotation on the iPhone and transitioning to split-screen mode on iPad.


Yeah I actually like AutoLayout and InterfaceBuilder but it is incredibly frustrating when it doesn’t work. It hates being over constrained, so your layout in IB makes logical sense to you but then the debugging console will clog with autolayout complaints about which constraint it had to break.

Also anything with scroll views and/or stack views has been a nightmare in my experience. What should happen is that the stack view and scroll view should “expand” outward from their sub views based on those sub views intrinsic content sizes. Instead a lot of the time autolayout seems to try to start with the scroll view or stackviews size and compress “inwards” and so the only way Autolayout thinks it can satisfy everything is for everything to have a size of zero and your views disappear.

Also mobile devices don’t seem to conform well with rigid grid systems from a design standpoint. System provided UI conponents(like tab bars and nav bars on iOS) have their own sizes that won’t conform to your grid, users can change text size (a good thing), and animations and “physics” (like UIKitDynamics) necessarily mean you won’t have a grid.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: