本文整理汇总了TypeScript中tns-core-modules/ui/page.Page.getViewById方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Page.getViewById方法的具体用法?TypeScript Page.getViewById怎么用?TypeScript Page.getViewById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tns-core-modules/ui/page.Page
的用法示例。
在下文中一共展示了Page.getViewById方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: exectuteOnAll
function exectuteOnAll(page: Page, callback: (txt: TextView | TextField) => void) {
page.getViewById("container").eachChild((child) => {
if(child instanceof TextView || child instanceof TextField) {
callback(child);
}
return true;
})
}
示例2: createPage
export function createPage() {
// https://github.com/NativeScript/cross-platform-modules/issues/61
var stackPanel = new panelModule.StackLayout();
stackPanel.id = "stackPanel";
var btn = new button.Button();
btn.text = "getViewById";
var page = new pages.Page();
page.content = stackPanel;
page.getViewById<panelModule.StackLayout>("stackPanel").addChild(btn);
return page;
}
示例3: destroyViewer
destroyViewer() {
const pdf = this.page.getViewById('pdf');
}
示例4: clearForm
clearForm(event) {
const pdf: any = this.page.getViewById('pdf');
pdf.setFormFields({ "Given Name Text Box": { "value": "" }, "Family Name Text Box": { "value": "" }, "House nr Text Box": { "value": "" }, "Address 2 Text Box": { "value": "" }, "Postcode Text Box": { "value": "" }, "Country Combo Box": { "value": "" }, "Height Formatted Field": { "value": "" }, "City Text Box": { "value": "" }, "Driving License CheckBox": { "value": "" }, "Favourite Colour List Box": { "value": "" }, "Language 1 Check Box": { "value": "" }, "Language 2 Check Box": { "value": "" }, "Language 3 Check Box": { "value": "" }, "Language 4 Check Box": { "value": "" }, "Language 5 Check Box": { "value": "" }, "Gender List Box": { "value": "" }, "Address 1 Text Box": { "value": "" } })
}
示例5: fillForm
fillForm(event) {
const pdf: any = this.page.getViewById('pdf');
pdf.setFormFields({ "Given Name Text Box": { "value": "Osei" }, "Family Name Text Box": { "value": "Fortune" }, "House nr Text Box": { "value": "3" }, "Address 2 Text Box": { "value": "" }, "Postcode Text Box": { "value": "000000" }, "Country Combo Box": { "value": "Trinidad & Tobago" }, "Height Formatted Field": { "value": "180" }, "City Text Box": { "value": "Siparia" }, "Driving License CheckBox": { "value": "Yes" }, "Favourite Colour List Box": { "value": "White" }, "Language 1 Check Box": { "value": "Yes" }, "Language 2 Check Box": { "value": "Yes" }, "Language 3 Check Box": { "value": "Yes" }, "Language 4 Check Box": { "value": "Yes" }, "Language 5 Check Box": { "value": "Yes" }, "Gender List Box": { "value": "Woman" }, "Address 1 Text Box": { "value": "Happy Hill Quinam Road" } });
}
示例6: getName
getName(event) {
const pdf: any = this.page.getViewById('pdf');
dialogs.alert(pdf.getFormField('Given Name Text Box'));
}