mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
Added some links to ApiReference.
This commit is contained in:
@ -23,7 +23,7 @@ export var testAll = function () {
|
|||||||
absoluteLayout.height = 230;
|
absoluteLayout.height = 230;
|
||||||
absoluteLayout.style.backgroundColor = new colorModule.Color("LightGray");
|
absoluteLayout.style.backgroundColor = new colorModule.Color("LightGray");
|
||||||
var label;
|
var label;
|
||||||
// Left Top
|
//// In absolute layout place of an UI element is determined by 4 parameters : left, top, width and height.
|
||||||
label = new labelModule.Label();
|
label = new labelModule.Label();
|
||||||
label.width = 100;
|
label.width = 100;
|
||||||
label.height = 100;
|
label.height = 100;
|
||||||
|
@ -498,18 +498,18 @@ export function test_GridLayout_padding() {
|
|||||||
export var test_codesnippets = function () {
|
export var test_codesnippets = function () {
|
||||||
// <snippet module="ui/layouts/grid-layout" title="grid-layout">
|
// <snippet module="ui/layouts/grid-layout" title="grid-layout">
|
||||||
// ## GridLayout sample
|
// ## GridLayout sample
|
||||||
// ### Create GridLayout with 3 columns - 80px, *, auto size and 2 rows - 100px and auto size
|
// ### Creating Grid Layout via code.
|
||||||
|
|
||||||
// ``` JavaScript
|
// ``` JavaScript
|
||||||
|
//var layout = require("ui/layouts/grid-layout");
|
||||||
var gridLayout = new layout.GridLayout();
|
var gridLayout = new layout.GridLayout();
|
||||||
|
// ```
|
||||||
|
|
||||||
|
// ### Add views to grid layout
|
||||||
|
// ``` JavaScript
|
||||||
var btn1 = new button.Button();
|
var btn1 = new button.Button();
|
||||||
var btn2 = new button.Button();
|
var btn2 = new button.Button();
|
||||||
var btn3 = new button.Button();
|
var btn3 = new button.Button();
|
||||||
var btn4 = new button.Button();
|
var btn4 = new button.Button();
|
||||||
// ```
|
|
||||||
|
|
||||||
// ### Add views to layout
|
|
||||||
// ``` JavaScript
|
|
||||||
gridLayout.addChild(btn1);
|
gridLayout.addChild(btn1);
|
||||||
gridLayout.addChild(btn2);
|
gridLayout.addChild(btn2);
|
||||||
gridLayout.addChild(btn3);
|
gridLayout.addChild(btn3);
|
||||||
@ -533,12 +533,17 @@ export var test_codesnippets = function () {
|
|||||||
layout.GridLayout.setColumnSpan(btn4, 3);
|
layout.GridLayout.setColumnSpan(btn4, 3);
|
||||||
// ```
|
// ```
|
||||||
|
|
||||||
// ### Create ItemSpec for columns and rows
|
// ### Create ItemSpec for columns and rows 3 columns - 80px, *, auto size and 2 rows - 100px and auto size
|
||||||
// ``` JavaScript
|
// ``` JavaScript
|
||||||
|
//// ItemSpec modes of the column refers to its width.
|
||||||
|
//// Absolute size of the column
|
||||||
var firstColumn = new layout.ItemSpec(80, layout.GridUnitType.pixel);
|
var firstColumn = new layout.ItemSpec(80, layout.GridUnitType.pixel);
|
||||||
|
//// Star width means that this column will expand to fill the gap left from other columns
|
||||||
var secondColumn = new layout.ItemSpec(1, layout.GridUnitType.star);
|
var secondColumn = new layout.ItemSpec(1, layout.GridUnitType.star);
|
||||||
|
//// Auto size means that column will expand or shrink in order to give enough place for all child UI elements.
|
||||||
var thirdColumn = new layout.ItemSpec(1, layout.GridUnitType.auto);
|
var thirdColumn = new layout.ItemSpec(1, layout.GridUnitType.auto);
|
||||||
|
|
||||||
|
//// Star and Auto modes for rows behave like corresponding setting for columns but refer to row height.
|
||||||
var firstRow = new layout.ItemSpec(1, layout.GridUnitType.auto);
|
var firstRow = new layout.ItemSpec(1, layout.GridUnitType.auto);
|
||||||
var secondRow = new layout.ItemSpec(1, layout.GridUnitType.star);
|
var secondRow = new layout.ItemSpec(1, layout.GridUnitType.star);
|
||||||
// ```
|
// ```
|
||||||
@ -551,5 +556,16 @@ export var test_codesnippets = function () {
|
|||||||
gridLayout.addRow(firstRow);
|
gridLayout.addRow(firstRow);
|
||||||
gridLayout.addRow(secondRow);
|
gridLayout.addRow(secondRow);
|
||||||
// ```
|
// ```
|
||||||
|
|
||||||
|
// ### Create same grid layout with an xml declaration
|
||||||
|
// ``` XML
|
||||||
|
// <GridLayout columns="80, *, auto" rows="auto, *" >
|
||||||
|
// <Button col="0" />
|
||||||
|
// <Button col="1" />
|
||||||
|
// <Button col="2" />
|
||||||
|
//// by default column and row are set to 0
|
||||||
|
// <Button row="1" colSpan="3" />
|
||||||
|
// </GridLayout>
|
||||||
|
// ```
|
||||||
// </snippet>
|
// </snippet>
|
||||||
};
|
};
|
@ -280,12 +280,7 @@ export var test_cssShouldBeAppliedToAllNestedElements = function () {
|
|||||||
StackLayout = new stackLayoutModule.StackLayout();
|
StackLayout = new stackLayoutModule.StackLayout();
|
||||||
StackLayout.addChild(label);
|
StackLayout.addChild(label);
|
||||||
testPage.content = StackLayout;
|
testPage.content = StackLayout;
|
||||||
//<snippet module="ui/page" title="Page">
|
|
||||||
//### Adding a css that affects all nested UI components.
|
|
||||||
//``` JavaScript
|
|
||||||
testPage.css = "stackLayout {background-color: #ffff0000;} label {background-color: #ff00ff00;}";
|
testPage.css = "stackLayout {background-color: #ffff0000;} label {background-color: #ff00ff00;}";
|
||||||
//```
|
|
||||||
//</snippet>
|
|
||||||
return testPage;
|
return testPage;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -14,12 +14,12 @@
|
|||||||
constructor(options?: Options);
|
constructor(options?: Options);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets or sets the soft keyboard type.
|
* Gets or sets the soft keyboard type. Possible values are contained in the [KeyboardType enumeration](../enums/KeyboardType/README.md).
|
||||||
*/
|
*/
|
||||||
keyboardType: string;
|
keyboardType: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets or sets the soft keyboard return key flavor.
|
* Gets or sets the soft keyboard return key flavor. Possible values are contained in the [ReturnKeyType enumeration](../enums/ReturnKeyType/README.md).
|
||||||
*/
|
*/
|
||||||
returnKeyType: string;
|
returnKeyType: string;
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets or sets a value indicating when the text property will be updated.
|
* Gets or sets a value indicating when the text property will be updated.
|
||||||
* Possible values are contained in the UpdateTextTrigger enumeration located in "ui/enums" module.
|
* Possible values are contained in the [UpdateTextTrigger enumeration](../enums/UpdateTextTrigger/README.md).
|
||||||
*/
|
*/
|
||||||
updateTextTrigger: string;
|
updateTextTrigger: string;
|
||||||
|
|
||||||
|
2
ui/image/image.d.ts
vendored
2
ui/image/image.d.ts
vendored
@ -61,7 +61,7 @@ declare module "ui/image" {
|
|||||||
url: string;
|
url: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets or sets the image stretch mode.
|
* Gets or sets the image stretch mode. Possible values are contained in the [Stretch enumeration](../enums/Stretch/README.md).
|
||||||
*/
|
*/
|
||||||
stretch: string;
|
stretch: string;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user