From the course: Building Native Mobile Apps with NativeScript and Angular 2

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Layouts

Layouts

- [Instructor] In NativeScript, we use Layout to position and align user interface elements on the screen. There are six predefined layouts that come out of the box with NativeScript, and they cover a huge variety of layout requirements. All these layouts inhered from a common layout parent class which in turn inheres from View, as did all the other UI elements we've seen before. Let's go through these right now. The FlexboxLayout is a nonconforming implementation of the CSS Flexbox Layout that you can find on the web. The AbsoluteLayout lets you set exact locations, left and top coordinates, for its children. The DockLayout arranges its children at its outer edges and allows its last child to take up the remaining space in the middle. The GridLayout is a very powerful one. It defines a rectangular layout area that consists of columns and rows, kind of like the table in HTML. The StackLayout is my favorite. It arranges its children horizontally or vertically. The direction is set with…

Contents