本文整理汇总了TypeScript中tns-core-modules/ui/builder.parse函数的典型用法代码示例。如果您正苦于以下问题:TypeScript parse函数的具体用法?TypeScript parse怎么用?TypeScript parse使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parse函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getViews
private getViews(template: string) {
let root = parse(template);
return {
root,
list: root.getViewById("repeater") as Repeater
};
};
示例2: getViews
private getViews(template: string) {
let root = parse(template);
return {
root,
list: root.getViewById("webview") as WebView
};
};
示例3: test_MultiParserTemplate
export function test_MultiParserTemplate() {
const file = fs.File.fromPath(fs.path.join(__dirname, "itemTemplates.xml"));
const xml = file.readTextSync();
const view: any = builder.parse(xml);
TKUnit.assertNotNull(view.items)
TKUnit.assertEqual(view.items.length, 1);
}
示例4: getViews
private getViews(template: string) {
let root = parse(template);
return {
root,
list: root.getViewById("list") as ListView,
cells: [
[root.getViewById("cell00") as ListView, root.getViewById("cell01") as ListView, root.getViewById("cell02") as ListView],
[root.getViewById("cell10") as ListView, root.getViewById("cell11") as ListView, root.getViewById("cell12") as ListView],
[root.getViewById("cell20") as ListView, root.getViewById("cell21") as ListView, root.getViewById("cell22") as ListView]
]
};
};
示例5: getViews
private getViews(template: string) {
let root = parse(template);
return {
root,
grid: root.getViewById("grid") as GridLayout,
stack: root.getViewById("stack") as GridLayout,
childFirst: root.getViewById("childFirst") as view.View,
cells: [
[root.getViewById("cell00") as view.View, root.getViewById("cell01") as view.View, root.getViewById("cell02") as view.View],
[root.getViewById("cell10") as view.View, root.getViewById("cell11") as view.View, root.getViewById("cell12") as view.View],
[root.getViewById("cell20") as view.View, root.getViewById("cell21") as view.View, root.getViewById("cell22") as view.View]
]
};
};