在 BlackBerry 的 ListField 中显示 EditField
在我的应用程序中,我必须在 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);
}
如何将编辑字段添加到行列表
In my app i have to display list of items with price in EditField
. How can i add EditField
in list?
For ListField
, i am using this code
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);
}
How can i add edit field to list of rows
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将无法实际将 EditField 放置在那里。最好的选择是仅使用 VerticalFieldManager 并将 LabelFields/EditFields 堆叠在其中。它仍然会滚动,只是不再是 ListField。
You won't be able to actually place the EditField in there. Your best bet is to use just a VerticalFieldManager and stack LabelFields/EditFields in there. It will still scroll, just won't be ListField.