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: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: HorizontalFieldManager Problem

Yes now i have added label directly on screen. Still the same effect.
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: HorizontalFieldManager Problem

Can you please show us the MainScreen code you have used, including the LabelField.

Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: HorizontalFieldManager Problem

public TestScreen()
{
super(MainScreen.VERTICAL_SCROLL | MainScreen.VERTICAL_SCROLLBAR|MainScreen.HORIZONTAL_SCROLL|MainScreen.HORIZONTAL_SCROLLBAR);

String s="Center";
LabelField lbl = new LabelField(s,LabelField.USE_ALL_WIDTH|LabelField.FIELD_HCENTER)
{
protected void paint(Graphics graphics)
{
graphics.setBackgroundColor(Color.LIGHTGRAY);
graphics.clear();
super.paint(graphics);
}
};
add(lbl);
}

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: HorizontalFieldManager Problem

I suspect you see a gray area at the top of the screen indicating the LabelField.  The question is, where does the text display?.

 

You have told this MainScreen that it can scroll horizontally, so it will give you a very wide screen.  I don't think that is what you wanted to do.  I think you wanted the LabelField to be added at the top, and the Fields underneath that to scroll sideways.  In which case you need to remove the horizontal scrolling from the MainScreen, add the LabelField to act as a 'header' to the MainScreen, and then add a Manager that will scroll Horizontally.  Add the Fields you want to scroll Horizontally to that scrolling Manager.

 

Does that make sense?

 

If that is not the effect you want to achieve, please describe what you want again. 

Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: HorizontalFieldManager Problem

Yes..thats what i want.. i want Label as a header..and the area under the label should scroll horizontally. Next to that after sum area under the 1st header another header comes again..the area under the 2nd header can also be scrolled horizontally.
Developer
Posts: 16,997
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: HorizontalFieldManager Problem

easy solution:
use setTitle(yourLabelField), then proceed as before without it.
----------------------------------------------------------
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: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: HorizontalFieldManager Problem

[ Edited ]

I have something like this on screen.

                                                                 

HEADER1

 

Content(Horizontally Scrollable)

 

HEADER2

 

Content(Horizontally Scrollable)

 

Headers should have backgroundcolor and it should be at center of the screen.

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: HorizontalFieldManager Problem

Are the two contents parts independently scrollable.  In other wrods, if the top part scrolls does the bottom part also scroll to same amount?

Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: HorizontalFieldManager Problem

no. Its variable. M getting data from server at runtime.
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: HorizontalFieldManager Problem

In that case you can use a solution like the suggestion I posted earlier.

 

You would have a normal MainScreen, with no horizontal scrolling.  Add a full width LabelField as we have discussed already, then add a horizontally scrolling Manager.  This Manager is your top section that can scroll horizontally.  Then add another full with LabelField and another horizontally scrolling Manager for your bottom section. 

 

Populate the two scrolling managers as you like.

 

OK?