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
New Developer
Posts: 44
Registered: ‎08-06-2009
My Device: Not Specified

Custom Layout Manager implemented - how to rid of vertical scrolling?

Hello,

 

I am adding a custom layout manager to my MainScreen.

 

class %Layout extends Manager{ static int offsetY, offsetX; static int[] Y, X; protected %Layout(long arg0){ super(arg0); offsetY= offsetX= 0; } ... protected void sublayout(int w, int h){ Field field; int numFields= this.getFieldCount(); int x=offsetX; int y=offsetY; for(int i=0; i<numFields; i++){ field= getField(i); y = Y[i]; x = X[i]; setPositionChild(field, x, y); layoutChild(field, w, h); } offsetX= offsetY= 0; setExtent(w,h); } ... }

I have tried passing both Manager.NO_VERTICAL_SCROLLBAR and Manager.NO_VERTICAL_SCROLL to the constructo, but the screen always scrolls down till the top of the furthest bottom Field comes to the Top. My Fields are being placed properly and I want them to occupy the whole screen without the ability to scroll.

 

Thank you in advance.

New Developer
Posts: 44
Registered: ‎08-06-2009
My Device: Not Specified

Re: Custom Layout Manager implemented - how to rid of vertical scrolling?

Just did a search and I solved it by adding

 

super(NO_VERTICAL_SCROLL);

 

 to my extended MainScreen's constructor (failed to mention that I was adding CustomLayoutManger to extended MainScreen).