2011-11-11 61 views
0

我有一個應用程序,UI組件動態添加到formField中。由於放置在屏幕上的UI控件是根據服務器響應決定的運行時間,有時屏幕會被多個組件填充。隨着屏幕元素的添加,我需要滾動屏幕來選擇放置在屏幕末尾的字段。但是,當我滾動窗體反彈,但滾動沒有發生預期的方式。現在我無法選擇放置在表單末尾的UI控件。在Sencha Touch中滾動問題

屏幕有3個組件,標題欄,按鈕停靠欄和一個表單域。這裏是我用於表單域的代碼

var formBase = new Ext.form.FormPanel({ 
       scroll: 'vertical', 
       xtype: 'form', 
       ui: 'round', 
// i have added the items and it shows on UI, As things are dynamic i cant place it here 
       items: [{}]; 

    }); 

幫我解決這個問題。

+0

你把這種形式另一個盤內?你能分享完整的代碼嗎?添加項目後,你是否調用formBase.doLayout();功能? – Swar

+0

謝謝我讓它工作。 –

+0

我已經使用scroll:'vertical',pinHeaders:true,現在它正在工作。 –

回答

2

試試這個應該工作。

Ext.apply(this, { 
      scroll: 'vertical', 
      pinHeaders: true, 
      dockedItems : [{}], 
      items : [] 
     }); 
     MyApp.views.MyScreenScreen.superclass.initComponent.call(this); 
    }, 
-1

添加height配置一些值可能會解決問題。

0

它發生是因爲窗體高度。將height屬性添加到傳遞給FormPanel的對象。事情是這樣的:

height: Ext.Viewport.getWindowHeight()-(the height of other compenents like toolbar) 

示例這將是:

height: Ext.Viewport.getWindowHeight()-50