mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
How-To files generated with markdown spippet injector
This commit is contained in:
@@ -161,42 +161,28 @@ export class StackLayoutTest extends testModule.UITest<StackLayout> {
|
||||
}
|
||||
|
||||
public test_codesnippets() {
|
||||
// <snippet module="ui/layouts/stack-layout" title="stack-layout">
|
||||
// ### import StackLayout and Button classes
|
||||
|
||||
// >> stack-layout-new
|
||||
// var StackLayout = require("ui/layouts/stack-layout").StackLayout;
|
||||
// >> (hide)
|
||||
// var Button = require("ui/button").Button;
|
||||
// ### Create StackLayout
|
||||
// ``` JavaScript
|
||||
// << (hide)
|
||||
var stackLayout = new StackLayout();
|
||||
// ```
|
||||
// << stack-layout-new
|
||||
|
||||
// ### Declaring a StackLayout.
|
||||
//``` XML
|
||||
// <Page>
|
||||
// <StackLayout orientation="horizontal">
|
||||
// <Label text="This is Label 1" />
|
||||
// </StackLayout>
|
||||
// </Page>
|
||||
//```
|
||||
// </snippet>
|
||||
|
||||
// ### Add child view to layout
|
||||
// ``` JavaScript
|
||||
// >> stack-layout-addchild
|
||||
var btn = new Button();
|
||||
stackLayout.addChild(btn);
|
||||
// ```
|
||||
// << stack-layout-addchild
|
||||
|
||||
// ### Remove child view from layout
|
||||
// ``` JavaScript
|
||||
// >> stack-layout-remove
|
||||
stackLayout.removeChild(btn);
|
||||
// ```
|
||||
// << stack-layout-remove
|
||||
|
||||
// ### Change layout orientation to Horizontal
|
||||
// ``` JavaScript
|
||||
// >> stack-layout-horizontal
|
||||
stackLayout.orientation = enums.Orientation.horizontal;
|
||||
// ```
|
||||
// << stack-layout-horizontal
|
||||
|
||||
// </snippet>
|
||||
}
|
||||
|
||||
private setup_percent(): layoutHelper.MyButton {
|
||||
|
||||
Reference in New Issue
Block a user