08-16-2010 11:01 PM
On Storm (360x480)
have created a GridFieldManager with
Rows = 200
Columns = 4
where each cell has
width = 90px
height = 90px
i would like to create a background image for this grid.
i have tried using
GridFieldManager gridFieldManager = new GridFieldManager(200, 4, GridFieldManager.FIXED_SIZE );
EncodedImage testImage = EncodedImage.getEncodedImageResource("img/backgrou
VerticalFieldManager vfm = new VerticalFieldManager(USE_ALL_WIDTH);
where backgroundimage.png is 360x480 and fits the whole screen.
When i scroll down the last row in the display, the background image also scrolls up and brings in another background images.
How can the background image be made to be FIXED while the grid scrolls ?
Looking fwd for a reply
08-17-2010 12:35 AM
did u tried to override the paint method of GridFieldManager and draw the image inside it.
GridFieldManager gridFieldManager = new GridFieldManager(200, 4, GridFieldManager.FIXED_SIZE )
final Bitmap back = Bitmap.getBitmapResource("back.png");
//if u r using encoded image u can convert that to bitmap and then use it
08-17-2010 12:44 AM
Try setting the background in vfm rather than gridFieldManager.
08-17-2010 02:22 PM
thanks for your replies.
I tried what you said but that does not seem to work because
draws the bitmap from (0,0) to (480,360)
and as we scroll down below pixel number 480, i am seeing blank(white) background
I tried your suggestion too,
but it has the same effect as
essentially, as i scroll down
1) the background image also scrolls up
2) New background image which is below the first background image, starts to show up.
What i want is
1) The background image should not scroll ie it should remain where it is
2) The rows of the gridfieldmanager should scroll
looking fwd for your help
note :- I am using GridFieldManager available in 5.0.0
08-17-2010 03:34 PM
I guess you can createBitmapBackground with four parameters -
and see if it changes anything.
One last thing to try:
Have a non-scrolling Manager (VerticalFieldManager(NO_VERTICAL_SCROLL)) with your Background and then add your vfm (now without background) to it and your gridFieldManager (also without background) to your vfm.
This adds another Manager to the hierarchy but should work.