3
我在LWUIT表單上有一個列表。我想爲此表單添加背景圖片。我嘗試使用下面的一段代碼。圖像正在後臺設置,但列表在滾動時扭曲。LWUIT列表滾動問題
categoryList=new List(categories.categoryVector);
categoryList.setListCellRenderer(new CategoryListCellRenderer());
Image img=parentMIDlet.constants.getBgImage();
//img=img.scaled(this.getPreferredW(), this.getPreferredH());
getStyle().setBackgroundType(Style.BACKGROUND_IMAGE_ALIGNED);
getStyle().setBackgroundAlignment(Style.BACKGROUND_IMAGE_ALIGN_CENTER);
getStyle().setBgImage(img);
//getStyle().setBgPainter(new ImagePainter(img));
addComponent(BorderLayout.CENTER,categoryList);
categoryList.isScrollableY();
categoryList.setFixedSelection(List.FIXED_NONE);
categoryList.addActionListener(new CategoryListActionListener(mainMIDlet,categoryList));
您能否顯示完整的代碼? –