Layout with Row and Column
Litho uses Yoga which is an implementation of Flexbox to measure and layout components on screen. If you have used Flexbox on the web before this should be very familiar. If you are more familiar with how Android normally performs Layout then Flexbox will remind you a lot of LinearLayout
.
In Litho you can use a Row
to achieve a similar layout to a horizontal LinearLayout
.
Or a Column
to achieve a similar layout to a vertical LinearLayout
.
To achieve an effect similar to a LinearLayout
with weights Flexbox provides a concept called flexGrow(<weight>)
.
If you would like to overlay one view on top of the other -- similar to a FrameLayout
-- Flexbox can do that with positionType(ABSOLUTE)
.
For more documentation of specific Flexbox properties check out the Yoga documentation or explore any web resources on how Flexbox works.