本文整理匯總了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]
]
};
};