/ / ListFieldクラスを使用してテキストの行を表示する方法 - ブラックベリー

ListFieldクラスを使ってテキストの行を表示するにはどうすればいいですか? - ブラックベリー

Plzは上記のトロピックに引用して私を助けます 行に含める必要があります

  row1      text    text  img
text    text

row2      text    text img
text    text

すべての行がそのように見えるはずです。実際には、抽出された複数のJSONデータを行に表示します。

回答:

回答№1は0

ちょうど電話する list.setRowHeight() これをすべて表示するのに十分な余裕を持たせてからListFieldCallback drawListRow() メソッド、各フィールドをペイントしてください。あなたがどのように好きなのか、さらに詳しい説明が必要な場合は、コメントを投稿して展開してください。

コメントの編集: 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);
}