2012-02-27 5 views
3

私はgraphics.drawLine方法でdrawListRow内部ブラックベリーListFieldをセパレータを追加したいが、ラインはすべて以下で描画されていないが、私はブラックベリーListFieldを項目セパレータ

drawListRow(ListField listField, Graphics g, int index,int y, int width) 
{ 
g.setColor(Color.BLACK); 
    Font f = g.getFont().derive(Font.BOLD,8,Ui.UNITS_pt); 
    g.setFont(f); 
    g.drawText (data[0], 10, y, Graphics.LEFT,Display.getWidth()); 
    f = g.getFont().derive(Font.SERIF_STYLE,6,Ui.UNITS_pt); 
    g.setColor(0xC4C3C4);//light gray 
    int h = f.getHeight() + 5; 
    g.setFont(f); 
    g.drawText (data[1], 13, y+h, Graphics.LEFT,Display.getWidth()); 
    g.drawBitmap((Display.getWidth()- 30), y+7, this.rightIcon.getWidth(), this.rightIcon.getHeight(), this.rightIcon, 0, 0); 
    index = (index==0)?1:index; 
    f = g.getFont().derive(Font.PLAIN,6,Ui.UNITS_pt); 
    g.setColor(0xC4C3C4);//light gray 
    g.drawLine(0, y+DIS_ROW_HEIGHT, Display.getWidth(), y+DIS_ROW_HEIGHT); 
} 

答えて

6

g.drawLine(0, y+DIS_ROW_HEIGHT-1, Display.getWidth(), y+DIS_ROW_HEIGHT-1); 
を試してみてくださいを使用していますソースです
+0

drawLineの大きな-1ピクセルthnx –

+0

DIS_ROW_HEIGHTとは何ですか? – Hasmukh

+0

これは行の高さです。あなたはlistField.getRowHeight()を呼び出すことでそれを得ることができます – rfsk2010

関連する問題