2
我怎麼能在BlackBerry模擬器安裝一個大的圖像,使整幅圖像而不會裁剪?能anyboby幫我一個代碼示例的圖像適合屏幕黑莓
我怎麼能在BlackBerry模擬器安裝一個大的圖像,使整幅圖像而不會裁剪?能anyboby幫我一個代碼示例的圖像適合屏幕黑莓
有許多你可能途徑做到這一點,但如果它符合你的要求,那麼backgroundfactory是很好的。 http://www.blackberry.com/developers/docs/4.6.0api/net/rim/device/api/ui/decor/BackgroundFactory.html
// specify the bitmap and xy positioning to meet your needs
Background background = BackgroundFactory.createBitmapBackground(Bitmap.getBitmapResource("bitmap.png"),Background.POSITION_X_LEFT, Background.POSITION_Y_BOTTOM, Background.REPEAT_NONE);
// create a field manager and set its BG to this one
VerticalFieldManager body = new VerticalFieldManager(USE_ALL_WIDTH|USE_ALL_HEIGHT);
body.setBackground(background);
add(body);
//Some other options
//Background.REPEAT_NONE
//Background.REPEAT_SCALE_TO_FIT
//Background.REPEAT_VERTICAL
//Background.REPEAT_HORIZONTAL
謝謝雷......這是真的有用 –
很高興我能幫助 –