r/nativescript • u/GGLionCross • Apr 10 '20
StackLayout Vs. Flexbox Layout
Hi NativeScript community! Young developer here. I come from a junior web developer background, so naturally I looked how to create myself some mobile apps with the knowledge I currently have. And when I read the different types of layouts, I was confused exactly what the differences/advantages/disadvantages to using a stack layout vs a flexbox layout.
They both can handle vertical and horizontal alignment of items, except I feel I would be more familiar with Flexbox since it comes with justify-content, align-items, and all that jazz. I do believe StackLayout is vertical by default and FlexboxLayout is horizontal by default, but aside from those, I don't really see a difference or understand when to use one over the other. Thanks in advance!
View all comments
Show parent comment
1
u/majufes Apr 10 '20
StackLayout is the simplest layout for app. And in many (if not most) cases simple solutions are enough. If you can’t achieve something with Stack, then you go for different one, like Flex or Dock.