本文整理匯總了TypeScript中tns-core-modules/ui/layouts/grid-layout.GridLayout.setRowSpan方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript GridLayout.setRowSpan方法的具體用法?TypeScript GridLayout.setRowSpan怎麽用?TypeScript GridLayout.setRowSpan使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tns-core-modules/ui/layouts/grid-layout.GridLayout
的用法示例。
在下文中一共展示了GridLayout.setRowSpan方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: createPage
export function createPage() {
var StackLayout = require("ui/layouts/stack-layout").StackLayout;
var Label = require("ui/label").Label;
var Image = require("ui/image").Image;
var stack = new StackLayout();
var grid = new gridModule.GridLayout();
stack.addChild(grid);
grid.addColumn(new gridModule.ItemSpec(80, "pixel"));
grid.addColumn(new gridModule.ItemSpec(1, "star"));
grid.addRow(new gridModule.ItemSpec(1, "auto"));
grid.addRow(new gridModule.ItemSpec(1, "auto"));
var defaultImageSource = imageSource.fromFile(__dirname + "/test.png");
var img = new Image();
img.source = defaultImageSource;
img.width = 80;
img.height = 80;
img.verticalAlignment = enums.VerticalAlignment.bottom;
gridModule.GridLayout.setRowSpan(img, 2);
grid.addChild(img);
var titleLabel = new Label();
titleLabel.textWrap = true;
titleLabel.text = "some text goes here";
gridModule.GridLayout.setColumn(titleLabel, 1);
grid.addChild(titleLabel);
var commentsLabel = new Label();
commentsLabel.text = "comments";
commentsLabel.verticalAlignment = enums.VerticalAlignment.bottom;
gridModule.GridLayout.setRow(commentsLabel, 1);
gridModule.GridLayout.setColumn(commentsLabel, 1);
grid.addChild(commentsLabel);
var page = new pages.Page();
page.content = stack;
page.css = "GridLayout { background-color: yellow } image { background-color: green } label { background-color: red } stackpnael { background-color: pink }";
return page;
}