我正在開發一款帶有預期目標OS5 +的黑莓應用程序。爲什麼列表的最後一行被刪減?
我正在創建一個GridFieldManager來顯示從Web服務中獲取的數據。第二列數據通常是多行的,所以我設置的行高度比標準高。這是我的GridFieldManager代碼:
//Creation and property settings
GridFieldManager myGrid = new GridFieldManager(myScreenData.getSpese().size(), 3, GridFieldManager.USE_ALL_WIDTH|GridFieldManager.VERTICAL_SCROLL);
myGrid.setColumnProperty(0,GridFieldManager.AUTO_SIZE, Display.getWidth()/3);
myGrid.setColumnProperty(1,GridFieldManager.AUTO_SIZE, Display.getWidth()/3);
myGrid.setColumnProperty(2,GridFieldManager.AUTO_SIZE, Display.getWidth()/3);
myGrid.setRowPadding(3);
myGrid.setMargin(3,0,3,0);
for(int i=1;i<myScreenData.getSpese().size()-1;i++){
myGrid.setRowProperty(i, GridFieldManager.FIXED_SIZE, getFont().getHeight()*3);
}
//title population
myGrid.insert(new LabelField("DATA"), 0,FIELD_LEFT);
myGrid.insert(new LabelField("CAUSALE"), 1,FIELD_LEFT);
myGrid.insert(new LabelField("IMPORTO"), 2,FIELD_LEFT);
//Data population
for (int i=0;i<myScreenData.getSpese().size()-1;i++){
System.out.println("aggiungo "+i+" di "+(myScreenData.getSpese().size()-1));
SpesaDateAsString mySpesa = (SpesaDateAsString)myScreenData.getSpese().elementAt(i);
myGrid.insert(new LabelField(mySpesa.getData(),LabelField.FIELD_LEFT|LabelField.FOCUSABLE),0+((i+1)*3),FIELD_LEFT);
myGrid.insert(new LabelField(mySpesa.getCausale(),LabelField.FIELD_LEFT|LabelField.FIELD_VCENTER),1+((i+1)*3),FIELD_LEFT);
myGrid.insert(new LabelField(mySpesa.getImporto(),LabelField.FIELD_LEFT),2+((i+1)*3),FIELD_LEFT);
}
System.out.println("aggiungo la tabella");
result.add(myGrid);
這裏的問題是,名單的最後一行被削減。下面是截圖:
有誰知道該怎麼辦?這是爲什麼發生?
我已經嘗試了行屬性(FIXED,AUTO,PREFERRED ... ETC)和填充和邊距的每種可能組合的參數的每種可能組合。有誰知道如何解決這個問題?
哪裏是截圖? – Signare
編輯,不知何故圖像鏈接不會顯示,所以我重新添加它。 – Th0rndike