07-28-2010 10:19 AM - edited 07-28-2010 10:21 AM
for (int i = 0; i < collection.size(); i++)
{
_list.setRowHeight(93);
_list.insert(i);
_callback.add(i);
}
_list.invalidateRange(0, collection.size());
here is where i am adding
public void drawListRow(ListField listField, Graphics graphics, int index,
int y, int width)
{
if (listField.getSelectedIndex() == index)
{
graphics.setColor(Color.BLACK);
graphics.drawBitmap(0, 0, _cellh.getWidth(), _cellh.getHeight(),
_cellh, 0, 0);
} else
{
graphics.drawBitmap(0, 0, _celln.getWidth(), _celln.getHeight(),
_celln, 0, 0);
}
}the above code is where it draws the list.
the above is of "MyCallback.java" file.
my problem is i can see the first listfield image as selected and unselected, and for all others i am getting the blue image as the theme image of the listfield it has.
can anybody help me with the issue?
i am attaching the screenshot also?
Solved! Go to Solution.
07-28-2010 10:55 AM
not able to see your screen shots!!
"my problem is i can see the first listfield image as selected and unselected, and for all others i am getting the blue image as the theme image of the listfield it has."
what do you mean by theme image. Are you refering to the default blue focus.. ?
07-28-2010 10:59 AM
yes i mean say that default blue focus only
07-28-2010 11:40 AM
This code is not correct:
graphics.drawBitmap(0, 0, _cellh.getWidth(), _cellh.getHeight(),
_cellh, 0, 0);
You need to use the y value that is supplied as the y location for the painting of the Bitmap.
graphics.drawBitmap(0, y, _cellh.getWidth(), _cellh.getHeight(),
_cellh, 0, 0);
This change needs to be repeated in a number of places.
07-29-2010 08:11 AM
thanks very peter.
i was struggling for this simple issue a lot. for the one screen which i made i was able to see the changes but here when i compared i overlooked the "y" parameter stuff.
thanks once again