⚠️ This lesson is retired and might contain outdated information.

Create an Absolute Positioned Layout Using AbsoluteLayout

Brad Martin
InstructorBrad Martin
Share this video with your friends

Social Share Links

Send Tweet
Published 8 years ago
Updated 2 years ago

We will use the AbsoluteLayout component to create a layout container which uses left-top coordinates to position its child components in a NativeScript app.

[00:00] Start by adding an absolute layout to your page. Inside of the absolute layout, we'll add a few view components. First, we'll add a button with the text set to hello. We need to set the left and top coordinates, so we'll use left set to 10 and top set to 100.

[00:30] We'll add another button with the text set to goodbye and the left position set to 140 and the top position to 250. Last, let's add a label with the text of Egghead and the left value set to 60 and the top set to 400. When we run this, these view components will be positioned absolute by their top left coordinates.

[01:06] Here they are. The hello button is positioned 10 from the left and 100 from the top of the view. The goodbye button is positioned 140 from the left and 250 from the top. Last, your Egghead label is 60 from the left and 400 from the top of the page.

egghead
egghead
~ an hour ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today