2012-12-27 78 views
1

在我的應用程序中,我設置verticalFieldManager的位圖圖像,但它重複。關於設置圖像我使用黑莓圖像背景重複

VerticalFieldManager vertical=new VerticalFieldManager(USE_ALL_HEIGHT | USE_ALL_WIDTH) 
{ 
    protected void sublayout(int maxWidth, int maxHeight) 
    {    
     super.sublayout(Display.getWidth(), Display.getHeight()); 
     setExtent(Display.getWidth(), Display.getHeight()); 
    } 
}; 

vertical.setBackground(BackgroundFactory.createBitmapBackground(
    Bitmap.getBitmapResource("bg_640.png"))); 

是表示喜歡Grey image is repeating four times

我在這裏停留。任何想法都會被打破。

感謝

+0

你能後的bg_640.png圖像文件在你的問題?這會讓它更清楚它應該是什麼樣子,也許爲什麼它目前不適合你? – Nate

回答

2

,而不是調用

vertical.setBackground(BackgroundFactory.createBitmapBackground(Bitmap.getBitmapResource("bg_640.png"))); 

使用this version of createBitmapBackground(Bitmap, int, int, int)

和傳遞參數如下:

vertical.setBackground(BackgroundFactory.createBitmapBackground(Bitmap.getBitmapResource("bg_640.png"), 
         Background.POSITION_X_LEFT, 
         Background.POSITION_Y_TOP, 
         Background.REPEAT_NONE));