Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 83
Registered: ‎02-19-2010
My Device: Not Specified
My Carrier: Vodafone
Accepted Solution

Title bar without gap

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! Smiley Sad

 

best regards

Maja

Developer
Posts: 16,997
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Title bar without gap

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.

 

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 83
Registered: ‎02-19-2010
My Device: Not Specified
My Carrier: Vodafone

Re: Title bar without gap

[ Edited ]

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! Smiley Sad

 

Developer
Posts: 16,997
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Title bar without gap

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.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 83
Registered: ‎02-19-2010
My Device: Not Specified
My Carrier: Vodafone

Re: Title bar without gap

Thanks a lot. Now, the title remain where he is Smiley Happy

Highlighted
Developer
Posts: 16,997
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Title bar without gap

please mark the thread as solved.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter