本文整理汇总了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;
}