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
Regular Contributor
geestring
Posts: 68
Registered: ‎12-19-2011
My Device: Torch
My Carrier: Virgin Mobile

GridFieldManager span across the width of screen

I'm having trouble wrapping my head around this problem, because it actually works when the gridfieldmanager is instantiated in the constructor of the MainScreen. If I load it after my json callback, or choose another month to load the gridfield again, I get the columns and rows being larger that I had set it.

 

theCalendar = null;
    theCalendar = new GridFieldManager(rows,7,GridFieldManager.FIXED_SIZE);


    int column_width = Display.getWidth() / 7;

for(int y=0;y<7;y++){

        theCalendar.setColumnProperty(y, GridFieldManager.FIXED_SIZE, column_width);
        System.out.println("column width:"+theCalendar.getColumnWidth(y));

    }

    for(int o=0;o<rows;o++){
        theCalendar.setRowProperty(o, GridFieldManager.FIXED_SIZE, 40);

    }

 

Like I said, if I fire this code in something other than the constructor, the rows and columns are larger than what I had set it as. I even checked getColumnWidth and it comes up as 68, which is right ( 480/7 ). Is there something wrong with my labelfields that I'm adding to it? I feel like it is a bug.

 

 

Please use plain text.
Regular Contributor
geestring
Posts: 68
Registered: ‎12-19-2011
My Device: Torch
My Carrier: Virgin Mobile

Re: GridFieldManager span across the width of screen

I'm going to try and use a table layout instead.
Please use plain text.