Exploring UI layout containers

NativeScript provides a recursive layout system that sizes and positions views on the screen. The layout system starts by measuring and positioning the layout containers and their child views. Layout is an intensive process whose speed and performance depend on the count of children and the complexity of the layout container. For example, a simple layout container, such as an absolute layout, might perform better than a more complex layout container, such as GridLayout.

Layout completes in two passes—a measure pass and a layout pass. To this end, each view provides a measure and layout methods. Additionally, each layout container provides its own onMeasure and onLayout to achieve its own specific layout.

NativeScript provides us with the following six different layout containers so that we can develop applications:

  • Absolute layout
  • Dock layout
  • Grid layout
  • Stack layout
  • Wrap layout
  • Flex layout

Let's look at each one of them briefly.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.198.43