02-19-2010 09:23 AM
Hello,
I'm really new in BlackBerry development and I have a question.
I want to show a VerticalFieldManager at top of the main screen and everytime I scroll the mainscreen the vfm will be shown. I know i could do this with setTitle(), but the Problem is, that after this title is a gap and on the BlackBerry Curve 8300 I see the startscreen in this little gap. This isn't beautiful!
Anyone understand what I mean and can help me? I serched the hole forum and no thread could answer my question! ![]()
best regards
Maja
Solved! Go to Solution.
02-19-2010 09:37 AM
the title manager does not only add the field or text but also a small gradient shadow and a separatorfield.
you can make your own title manager like this:
create a verticalfieldmanager (vfm) with USE_ALL_HEIGHT | USE_ALLWIDTH | NO_VERTICAL_SCROLL
add it to the screen
add your title manager to the vfm
create a screen-verticalfieldmanager to manage your normal fields with the VERTICAL_SCROLL style and add it to the vfm.
add all your fields to the screen-vfm. you can scroll it while the title manager stays on top.
a status manager would be similar, but would need some sublayout mojo to be correctly placed.
02-19-2010 09:55 AM - edited 02-19-2010 09:56 AM
I tried it! Here's my code:
VerticalFieldManager fieldManagerAll = new VerticalFieldManager(USE_ALL_HEIGHT | USE_ALL_WIDTH | NO_VERTICAL_SCROLL){
protected void paint(Graphics graphics)
{
graphics.setBackgroundColor(0x0060AC);
graphics.setColor(Color.WHITE);
graphics.clear();
super.subpaint(graphics);
}
protected void subpaint(Graphics graphics){
int height = Display.getHeight();
int width = Display.getWidth();
super.sublayout(width, height);
}
};
VerticalFieldManager fieldManagerTop = new VerticalFieldManager(USE_ALL_WIDTH | NO_VERTICAL_SCROLL){
protected void paint(Graphics graphics)
{
graphics.setBackgroundColor(0x0060AC);
graphics.setColor(Color.WHITE);
graphics.clear();
super.subpaint(graphics);
}
protected void subpaint(Graphics graphics){
int height = Display.getHeight() / 8;
int width = Display.getWidth();
super.sublayout(width, height);
}
};
VerticalFieldManager fieldManagerMiddle = new VerticalFieldManager(USE_ALL_WIDTH | VERTICAL_SCROLL){
protected void paint(Graphics graphics){
graphics.setBackgroundColor(0x0060AC);
graphics.setColor(Color.WHITE);
graphics.clear();
super.subpaint(graphics);
}
protected void subpaint(Graphics graphics){
int height = (Display.getHeight() / 8) * 7;
int width = Display.getWidth();
super.sublayout(width, height);
}
};
fieldManagerAll.add(fieldManagerTop);
fieldManagerAll.add(fieldManagerMiddle);
add(fieldManagerAll);
But it doesn't act! When I scroll the vfm in the middle the title disappear! ![]()
02-19-2010 10:10 AM
yes, you are right, i checked my own code and forgot something:
use super(NO_VERTICAL_SCROLL) in the screen constructor to disable the scrolling in the screens own manager.
02-19-2010 10:16 AM
Thanks a lot. Now, the title remain where he is ![]()
02-19-2010 10:23 AM
please mark the thread as solved.