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: 40
Registered: ‎06-04-2014
My Device: Bold 9900
Accepted Solution

Aligning fields

I've gone around and around with this issue and haven't found anything definitive posted in this forum. I'm trying to add a footer to my app. The footer consists of two LabelFields, one left aligned and the other right aligned like so. However, no matter what I try, the best I can get is a layout like the following:

 

Screen Shot 2014-08-01 at 9.35.54 AM.png

 

The footer itself is taking up the entire width of the screen which is OK. The Footer is a HorizontalFieldManager

and the Copyright and Terms Labels are themselves contained in their own VerticalFieldManager. The issue I'm having, as you can see above is that the Terms field is left aligned within it's half of the screen. How can I get it to be right aligned?

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

Re: Aligning fields

The best way to do this involves creating a Manager that will position the two Fields correctly.  You would use this Manager in place of your HFM and two VFMs.  This Manager would check to make sure trhere were only 2 Fields, layout each of these Fields and the position them to the left and right.

 

I would encourage you to try to do this, as it is not too difficult and you will learn a lot about manging BB Fields.

 

Here is video:

http://supportforums.blackberry.com/t5/Java-Development/How-to-Extend-Manager/ta-p/446749

 

and a KB article:

http://supportforums.blackberry.com/t5/Java-Development/Create-a-custom-layout-manager-for-a-screen/...

 

Feel free to come back here for more if you can't get this working. 

 

Highlighted
Developer
Posts: 40
Registered: ‎06-04-2014
My Device: Bold 9900

Re: Aligning fields

Peter, thanks for the response. I ended up using this library (which I think I found in one of your previous replies to someone who had a similar issue):

 

https://github.com/blackberry/Samples-for-Java/tree/master/Advanced%20UI/src/com/samples/toolkit/ui/...

 

 

Specifically, I used the JustifiedHorizontalFieldManager.java  class.

New Developer
New Developer
Posts: 16
Registered: ‎10-22-2008
My Device: Not Specified

Re: Aligning fields

Take a look at this article:

http://keraisureshvblackberry.blogspot.in/2012/02/there-are-very-common-there-there-are.html

 

It describes how to make custom field manager with two field alligned at Left/Right -> the same as you need.