mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
31 lines
645 B
Markdown
31 lines
645 B
Markdown
---
|
|
nav-title: "stack-layout How-To"
|
|
title: "stack-layout"
|
|
description: "Examples for using stack-layout"
|
|
---
|
|
# StackLayout
|
|
Using a StackLayout requires the StackLayout module.
|
|
<snippet id='stack-layout-require'/>
|
|
|
|
### Declaring a StackLayout.
|
|
``` XML
|
|
<Page>
|
|
<StackLayout orientation="horizontal">
|
|
<Label text="This is Label 1" />
|
|
</StackLayout>
|
|
</Page>
|
|
```
|
|
|
|
## Create StackLayout
|
|
<snippet id='stack-layout-new'/>
|
|
|
|
## Add child view to layout
|
|
<snippet id='stack-layout-addchild'/>
|
|
|
|
## Remove child view from layout
|
|
<snippet id='stack-layout-remove'/>
|
|
|
|
## Change layout orientation to Horizontal
|
|
<snippet id='stack-layout-horizontal'/>
|
|
|