當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Page.getViewById方法代碼示例

本文整理匯總了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;
    })
}
開發者ID:sitefinitysteve,項目名稱:NativeScript,代碼行數:8,代碼來源:hint-text-color.ts

示例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;
}
開發者ID:NathanWalker,項目名稱:NativeScript,代碼行數:16,代碼來源:i61.ts

示例3: destroyViewer

 destroyViewer() {
     const pdf = this.page.getViewById('pdf');
 }
開發者ID:sean-perkins,項目名稱:nativescript-pspdfkit,代碼行數:3,代碼來源:items.component.ts

示例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": "" } })
 }
開發者ID:sean-perkins,項目名稱:nativescript-pspdfkit,代碼行數:4,代碼來源:item-detail.component.ts

示例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" } });
 }
開發者ID:sean-perkins,項目名稱:nativescript-pspdfkit,代碼行數:4,代碼來源:item-detail.component.ts

示例6: getName

 getName(event) {
     const pdf: any = this.page.getViewById('pdf');
     dialogs.alert(pdf.getFormField('Given Name Text Box'));
 }
開發者ID:sean-perkins,項目名稱:nativescript-pspdfkit,代碼行數:4,代碼來源:item-detail.component.ts


注:本文中的tns-core-modules/ui/page.Page.getViewById方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。