0
我想讓背景圖像拉伸所有屏幕。我只是創建了一個VerticalFieldManager並修改了繪製方法。將位圖繪製爲MainScreen背景。如何拉伸圖像?
verticalFieldManager = new VerticalFieldManager(VerticalFieldManager.USE_ALL_WIDTH
| VerticalFieldManager.NO_HORIZONTAL_SCROLLBAR) {
public void paint(Graphics graphics) {
graphics.drawBitmap(0, 0, this.getWidth(), this.getHeight(),
backgroundBitmap, 0, 0);
super.paint(graphics);
}
};
而當我添加一個ListField到verticalFieldManager和滾動,背景圖像不重畫。滾動時如何重繪背景?
好極了,它的工作原理。非常感謝你阿哈邁德。 你能幫我解決ListField滾動問題嗎?當我滾動時,背景圖像也滾動。滾動事件發生時應該重繪背景圖像嗎? – redline 2011-04-21 11:31:23
哦,不,當我使用這個代碼時,在listview的最後一項之後總是有一個空格。這是不好的。 – redline 2011-04-21 11:56:05
爲了幫助解決滾動問題,我需要試驗一下代碼。對不起,現在實驗是不可能的 - 我也面臨時間壓力。然而,您嘗試的想法是將BG繪圖的開始Y座標轉換爲與當前Ysroll相同的像素數(使用容器的'Manager.getVerticalScroll()')。 – 2011-04-21 11:58:32