我正在使用LWUIT開發J2ME應用程序。 我需要顯示10個值,每個值爲Label
。J2ME LWUIT - 滾動時顯示外部屏幕標籤的錯誤
事情是這樣的:
Label1 Value1
Label2 Value2
Label3 Value3
Label4 Value4
............
LabelN ValueN
我使用1 Container
每個「行」和一個大Container
每個「行容器」
我的問題是與「行」之外屏幕。當我使用滾動時,最後4對Label
+值不顯示
我不知道爲什麼。 有人可以解決這個問題嗎?
這是我的代碼:
this.setLayout(new BorderLayout());
PromotionMonitorDTO promotionMonitorDTO = Cloud.getPromotionMonitor();
Utils utils = new Utils();
Font f = Font.getBitmapFont("movSmall");
Container cellContainer = new Container(new BoxLayout(BoxLayout.Y_AXIS));
Container rowContainer = new Container(new BoxLayout(BoxLayout.X_AXIS));
//FIRST PAIR///////////////////////
String stringValue = utils.calendarToShorString(promotionMonitorDTO.getLastUpdate());
Label valor = new Label(LanguageManager.getText("LastUpdate"));
valor.getStyle().setFont(f);
rowContainer.addComponent(valor);
valor = new Label(LanguageManager.getText(stringValue));
valor.getStyle().setFont(f);
rowContainer.addComponent(valor);
cellContainer.addComponent(rowContainer);
rowContainer = new Container(new BoxLayout(BoxLayout.X_AXIS));
//SECOND PAIR///////////////////////
stringValue = String.valueOf(promotionMonitorDTO.getInitialTarget());
valor = new Label(LanguageManager.getText("InitialTarget"));
valor.getStyle().setFont(f);
rowContainer.addComponent(valor);
valor = new Label(LanguageManager.getText(stringValue));
valor.getStyle().setFont(f);
rowContainer.addComponent(valor);
cellContainer.addComponent(rowContainer);
////////8 MORE PAIRS////////////////////
this.addComponent(BorderLayout.NORTH, cellContainer);
不要刪除,您必須接受您的回答 – frayab
接受您的回答 – Mun0n
在問題是48小時前不能接受自我回答。那麼這樣做是適當的。 –