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: 26
Registered: ‎06-24-2009
My Device: Not Specified

GridFieldManager scrolling problem

hi,

 

i added images in GridFieldManager,

        GridFieldManager grid = new GridFieldManager(2, 3, 0);
        Bitmap bitmap = new Bitmap(160,240);
        grid.add(new BitmapField(bitmap.getBitmapResource("Blue hills.jpg")));
        grid.add(new BitmapField(bitmap.getBitmapResource("Sunset.jpg")));
        grid.add(new BitmapField(bitmap.getBitmapResource("Water lilies.jpg")));
        grid.add(new BitmapField(bitmap.getBitmapResource("Winter.jpg")));
        grid.add(new BitmapField(bitmap.getBitmapResource("Blue hills.jpg")));

        grid.setColumnPadding(10);
        grid.setRowPadding(10);

        add(grid);

 

vertical scrolling working fine but, when i try to do horizontal scrolling it not happening.

 

please help me to resolve this issue.

 

reddy

Trusted Contributor
Posts: 176
Registered: ‎04-12-2012
My Device: Bold 9780 & Curve 8250
My Carrier: vodacom

Re: GridFieldManager scrolling problem

any sollutions here??

Developer
Posts: 180
Registered: ‎12-09-2011
My Device: 9360, BB10
My Carrier: Aircel

Re: GridFieldManager scrolling problem

add the grid field manager into a horizontal field manager and make it HORIZONTAL_SCROLL.

 

and then add that horizontal manager into the screen.

Trusted Contributor
Posts: 176
Registered: ‎04-12-2012
My Device: Bold 9780 & Curve 8250
My Carrier: vodacom

Re: GridFieldManager scrolling problem

GridFieldManager gfm = new GridFieldManager(1,6, Manager.HORIZONTAL_SCROLL | Manager.HORIZONTAL_SCROLLBAR | Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR);

final CheckboxField back1_1 = new CheckboxField("", false,FOCUSABLE);
final CheckboxField back1_2 = new CheckboxField("", false,FOCUSABLE);
final CheckboxField back1_3 = new CheckboxField("", false,FOCUSABLE);

gfm.add(new BitmapField(Bitmap.getBitmapResource("facebook.png")));
gfm.add(back1_1);

gfm.add(new BitmapField(Bitmap.getBitmapResource("twitter.png")));
gfm.add(back1_2);

gfm.add(new BitmapField(Bitmap.getBitmapResource("icon.png")));
gfm.add(back1_3);

add(gfm);