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: 34
Registered: ‎11-20-2009
My Device: Not Specified

How do I set height in custom HorizontalFieldManager?

I tried reading couple of threads with same topic name .. but did not find any information. ...

 

right now i have a custom HorizontalFieldManager wherein i override the getPrefferedHeight to DIsplay / 2

 

    public int getPreferredHeight()
    {
        return Display.getHeight()/2;
    }

 

but when i add a VerticalManager to this and add 10 buttons to vertical manager .... it covers the entire scree n....

 

WHat i need it .... sceen into 2 parts ... 1st part srollable list like thing and 2nd part a image which changes based on what is selected on the list on top part ...

 

Awainting any kindaa help .... have a time crunch

 

thanks guys

Developer
Posts: 34
Registered: ‎11-20-2009
My Device: Not Specified

Re: How do I set height in custom HorizontalFieldManager?

ANy help please????

 

THank you.

 

 

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: How do I set height in custom HorizontalFieldManager?

You don't really set the height of a manager, the manager takes the height of it's managed fields. A Manager with no fields will have a height/width of 0,0.

 

 

Highlighted
Developer
Posts: 94
Registered: ‎10-01-2009
My Device: Not Specified

Re: How do I set height in custom HorizontalFieldManager?

Sometimes you have to get a little creative in your search keywords.  Did you find this one?

http://supportforums.blackberry.com/t5/Java-Development/VerticalFieldManager-with-fixed-size-Scroll-...

Maybe not the best example, but you may find the included code useful.

 

Also, check out the instructional videos.  Andre Fabris has a couple of relatively new ones called "How to Extend the Screen" and "How to Extend Manager".

 

My guess is that you implemented getPreferredHeight but not sublayout in your custom layout manager.  For example, here is a snippet taken from working code that makes a scrollable region half the height of the screen.  I "borrowed" the sublayout implementation verbatim from the post I linked above.

 

class MyVFM extends VerticalFieldManager {
	[...]
	public int getPreferredHeight() {
	    return Display.getHeight() / 2;
	}

	protected void sublayout(int width, int height) {
	    super.sublayout(width, getPreferredHeight());
	    setExtent(width, getPreferredHeight());
	}
	[...]
}

 

Developer
Posts: 222
Registered: ‎11-11-2009
My Device: Storm

Re: How do I set height in custom HorizontalFieldManager?

@KedarKarthick:

         what the sample code given by jMarc was correct, you can use it, which will give you the solution.

        Becuase what size (width and height) you have given in setExtent() will be the size for the Field or custom Field (here it is HorizontalFieldManager)

 

 

with regards,
Vignesh J

-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Don't forget to mark your post as solved if you get the answer and dont forget to give kudos if the answer is useful for you.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------