02-05-2010 10:48 AM
I'm trying to achieve the following: a screen with a custom layout (read from an XML file) with the possibility to scroll up and down. Due to the existing application structure I cannot use the Blackberry focusing mechanism and instead have to rely on VerticalFieldManager.setVerticalScroll() for scrolling and VerticalFieldManager.getFieldAtLocation() for my own "focusing".
However, I'm getting stuck with something much simpler: when I created a custom MainScreen (a few private members, a few private initialization methods and overridden keyChar() and navigationMovement()) with the first line in constructor reading super(NO_VERTICAL_SCROLL) and then added a custom VerticalFieldManager with super(VERTICAL_SCROLL) as the first line in the constructor, that custom VerticalFieldManager did not get the full height (0x3FFFFFFF) in its sublayout() routine, but rather 266 (with BB9000 simulator having 280 height - I suppose 14 is the height of the title in the MainScreen). This is, naturally, insufficient for my needs.
What's interesting is that when I use super(VERTICAL_SCROLL) in my custom MainScreen, the underlying VerticalFieldManager (with VERTICAL_SCROLL as well) does get the full height in its sublayout() method (not 0x3FFFFFF1, but the full 0x3FFFFFFF). However, I'm afraid it will not be scrolled correctly by VerticalFieldManager.setVerticalScroll(). I guess I might get what I need using setVerticalScroll of the MainScreen rather than the underlying VerticalFieldManager, even though that would complicate the code.
How can I achieve what I need? I need the code to work under 4.2 (we have a lot of customers who are still using it).
Thanks in advance,