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
Trusted Contributor
jaff
Posts: 115
Registered: ‎11-16-2011
My Device: Smartphone Storm 9900
Accepted Solution

How to set menu on top static when scroll down???

how to create appliaction get static menu on top static when  scroll bar down???

 

for example

 

|| Menu 1 || Menu 2 | Menu 3 ||

 

Contain 1

Contain 2

etc...

 

when i move on contain in bottom, menu on top get move up... i want it get static when i move scroll down,,, any solution???

Please use plain text.
Developer
simon_hain
Posts: 16,209
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: How to set menu on top static when scroll down???

create the screen with NO_VERTICAL_SCROLL
for the scrollable part use a VerticalFieldManager with SCROLLABLE style.
----------------------------------------------------------
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
Please use plain text.
Developer
pradeep_ch
Posts: 543
Registered: ‎12-23-2010
My Device: Z10

Re: How to set menu on top static when scroll down???

[ Edited ]

Hi Jaff,

 

Solution means , you have to add managers like this.

First set NO_VERTICAL_SCROLL for the screen.

 

Suppose menu is a Horizontal manager add directly to screen like add(hfmMenu);

Now take two verticalFieldManagers vfm1,vfm2.

 

vfm1 = new VerticalFieldManager(VERTICAL_SCROLL);

 

vfm2 = new VerticalFieldManager(NO_VERTICAL_SCROLL);

vfm2.add(item1);

vfm2.add(item2);

..... etc

now

vfm1.add(vfm2);

 

add(vfm1);

 

so now you have two components on the screen

 

now override sublayout for screen and layout these two managers as your required widths and heights.

 

Thanks.

Please use plain text.
Trusted Contributor
jaff
Posts: 115
Registered: ‎11-16-2011
My Device: Smartphone Storm 9900

Re: How to set menu on top static when scroll down???

i think NO_VERTICAL_SCROLL just set for screen not move when scroll vertical... not for a component, i have just try that,,,but not working...any solution more???

Please use plain text.
Trusted Contributor
jaff
Posts: 115
Registered: ‎11-16-2011
My Device: Smartphone Storm 9900

Re: How to set menu on top static when scroll down???

i create menu on top with Manager Horizontal Field manager...

Please use plain text.
Contributor
andev
Posts: 34
Registered: ‎10-19-2011
My Device: 9800

Re: How to set menu on top static when scroll down???

jaff, you can also try something like this

HorizontalFieldManager _hfmHeader = new HorizontalFieldManager();

_hfmHeader.add(Menu_1);
_hfmHeader.add(Menu_2);
...
_hfmHeader.add(Menu_N);

this.setBanner(_hfmHeader);

 

Please use plain text.
Developer
arkadyz
Posts: 2,268
Registered: ‎07-08-2009
My Device: various

Re: How to set menu on top static when scroll down???

Use banner or title area for the menu items - put them all in a HorizontalFieldManager and add that manager to your MainScreen as a banner. 

 

More details here:

MainScreen explained

 

If you are not using MainScreen (which you might not want for one reason or another) use the approach recommended by simon_hain - a non-scrolling screen (or, more specifically, a screen with a non-scrolling VerticalFieldManager as delegate) with a HorizontalFieldManager with menu items on top and a scrolling VerticalFieldManager with the content under it.

 

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!
Please use plain text.
Trusted Contributor
jaff
Posts: 115
Registered: ‎11-16-2011
My Device: Smartphone Storm 9900

Re: How to set menu on top static when scroll down???

andev, thats a great solution and simple...

setTitle (for 1st Top )

setBanner (for 2nd Top)

thanks,,,

Please use plain text.