mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-19 14:20:22 +08:00
33 lines
710 B
Markdown
33 lines
710 B
Markdown
---
|
|
nav-title: "stack-layout How-To"
|
|
title: "stack-layout"
|
|
environment: nativescript
|
|
description: "Examples for using stack-layout"
|
|
previous_url: /ApiReference/ui/layouts/stack-layout/HOW-TO
|
|
---
|
|
# StackLayout
|
|
Using a StackLayout requires the StackLayout module.
|
|
{%snippet stack-layout-require%}
|
|
|
|
### Declaring a StackLayout.
|
|
``` XML
|
|
<Page>
|
|
<StackLayout orientation="horizontal">
|
|
<Label text="This is Label 1" />
|
|
</StackLayout>
|
|
</Page>
|
|
```
|
|
|
|
## Create StackLayout
|
|
{%snippet stack-layout-new%}
|
|
|
|
## Add child view to layout
|
|
{%snippet stack-layout-addchild%}
|
|
|
|
## Remove child view from layout
|
|
{%snippet stack-layout-remove%}
|
|
|
|
## Change layout orientation to Horizontal
|
|
{%snippet stack-layout-horizontal%}
|
|
|