/ / Como usar a classe ListField para exibir linhas de texto? - Amora

Como usar a classe ListField para exibir linhas de texto? - Amora

Plz me ajudar em citado ao trópico acima mencionado A linha deve conter

  row1      text    text  img
text    text

row2      text    text img
text    text

Cada linha deve ficar assim. Na verdade, ele exibirá vários dados JSON extraídos em linhas.

Respostas:

0 para resposta № 1

Apenas ligue list.setRowHeight() para se dar espaço suficiente para exibir tudo isso e, em seguida, no seu ListFieldCallback "s drawListRow() método, pintar cada campo como você gostaria.Se você precisar de mais explicações postar um comentário e eu posso expandir.

Edite para comentários: Você pode fazer algo assim em drawListRow ()

public void drawListRow(Graphics graphics, int index, int y, int width) {
//get your strings from the vector, I"m calling them t1 and t2 and the image img

//draw the top line of text
graphics.drawText(t1, 0, y);
//draw the second line of text
graphics.drawText(t1, 0, y + getFont().getHeight()); //You can cache the font height for performance if you want

//draw the bitmap
graphics.drawText(width - img.getWidth(), y, img, 0, 0);
}