【问题标题】:Display an EditField in a ListField of BlackBerry在 BlackBerry 的 ListField 中显示 EditField
【发布时间】:2011-07-05 11:50:50
【问题描述】:

在我的应用程序中,我必须显示价格为EditField 的项目列表。如何在列表中添加EditField

对于ListField,我正在使用此代码

public void drawListRow(ListField listField, Graphics graphics, int index,
        int y, int width) {

    this.listField=listField;
    String text=(String) get(listField, index);
    if(holder[index]==null)
    {
        holder[index]=placeholder;
    }
    graphics.setColor(rgb);
    graphics.setFont(Utility.getBigFont(DConfig.getFSize()+4));
    graphics.drawBitmap(3,y+7,placeholder.getWidth(), placeholder.getHeight(),holder[index], 0, 0);
    graphics.drawText(text,100,y+15);  
    graphics.drawText("Price:",100,y+30);
    graphics.drawText(CartScreen.price[index],100,y+45);
    graphics.drawLine(0, y+74, DConfig.disWidth, y+74);
}

如何将编辑字段添加到行列表中

【问题讨论】:

    标签: blackberry java-me listfield


    【解决方案1】:

    您将无法实际将 EditField 放置在其中。您最好的选择是仅使用 VerticalFieldManager 并在其中堆叠 LabelFields/EditFields。它仍然会滚动,只是不会是 ListField。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-07
      相关资源
      最近更新 更多