03-17-2011 10:23 PM
I am trying to create a screen (extending MainScreen) containing two horizontal managers with horizontal scrolling.. withing the managers there are other custom managers including bitmapfields and labelfields. I've set the bitmapfields to Focusable and overriden the onFocus function to change the background color when gained focus. I can scroll vertically but the view and the scrolling are not in sync as well as the horizontal scrolling within the fields doesn't work at all...any advice?
03-18-2011 03:13 AM
are you set layout to the Horizontal manager in which you add the bitmapfield?
if yes, then you can not set that manager property as HORIZONTAL_SCROLL and FOCUSABLE.
to solve this problem,
you have to take another HorizontalFieldManager with not override method and set property HORIZONTAL_SCROLL and FOCUSABLE etc..
and after that add HFM3_1 into HFM3..
HFM3_1 = new HorizontalFieldManager(HORIZONTAL_SCROLL |FOCUSABLE);
this will work for you... Enjoy...
Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
03-19-2011 08:32 PM
First of all, I trust you did specify HORIZONTAL_SCROLL flag in your HorizontalFieldManagers. Just asking.
Second - what do you mean "view and scrolling are not in sync"? What do you see? What exactly feels not intuitive?
Third - horizontal scrolling within fields inside HFM? This is not an easy proposition - you will have to override sublayout in those inner managers to limit their width, as well as create them with HORIZONTAL_SCROLL flag as well. Can you show the relevant sublayout() code?
Meanwhile, since you have many scrolling managers and can travel between them, take a long look at NO_SCROLL_RESET style flag in managers. Depending on what exactly you are trying to achieve, you might or might not need it.
03-24-2011 08:50 AM
The implementation is very simple. Where ever you want to implement horizontal scrolling add NullField to the end of particular HorizontalFieldManager and one NullField to the main VerticalFieldManager where you are adding all the managers.
I hope this will the implementation as u mentioned.