View Single Post
Old 04-29-2008, 04:45 AM   #9 (permalink)
baran_khan
Thumbs Must Hurt
 
baran_khan's Avatar
 
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here it is...all we have to do is to provide the height and width of the vertical manager...

package customElements;

import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.container.VerticalFieldManag er;

public class CustomVerticalLayout extends VerticalFieldManager
{
public CustomVerticalLayout()
{
super(VERTICAL_SCROLL|VERTICAL_SCROLLBAR);
}

int Width = 318;
int h= 120;
protected void sublayout(int maxWidth, int maxHeight)
{
super.sublayout(Width, h);
setExtent(Width, h);//This is where i want only the width but not the height...
}

public int getPreferredWidth()
{
return Width;
}

public int getPreferredHeight()
{
return h;
}
}

The height should remain incremental...which m not able to do right now...
Offline   Reply With Quote