03-30-2013 03:19 AM
I have an HFM where i have two images each occupying the entire screen.Now suppose i start to scroll,i want that the image whose portion is more visible in the screen that one should occupy the screen,just like blackberry appworld
03-30-2013 09:34 AM
Similar questions have been asked in the past, search the forum.
The simple solution is to set focus on the item you want to occupy the whole screen. The Managers will make sure that all of the focusable Field is visible, so you make your entire image focusable, then it should all display. You might want to override drawFocus on the Image to make sure it does not attempt to draw anything visible.
Then the question is which Field do you put focus on to, given you have multiple images like App World.
One easy way round this is to have a Scroll Listener for the HFM containing the Fields. Have it start a Thread (only one Thread) when scroll movement is detected, and this Thread will monitor the current HFM scroll position frequently. When it looks like t has stopped moving, or is not moving very quickly, it can calculate based on the virtual width o the HFM and the current scroll position, which item should be in focus, and set the focus on that. if that item already has focus, then the Thread has done its job and can stop.
There are more complicated ways of doing this, which I suspect App World uses
And then of course there is PictureScrollField, which is probably the first thing you you should look at.