我正在开发一个黑莓应用程序,我是黑莓手机的新手。我正在使用每个屏幕中的标签字段,但是在Labelfield上有一种颜色,除了我给出的屏幕上的背景,就像我在这里给出的图像一样。

这是我的应用程序中的标题,每个屏幕都有它。在这里,您可以在“状态版本”周围看到白色颜色。它看起来不太好。我想要橙色背景颜色在白色颜色的地方。谢谢,提前...

有帮助吗?

解决方案

You are using the following code.. (from your comment)

lF1= new LabelField("state editions",LabelField.FIELD_LEFT |FIELD_VCENTER) {
    public void paint(Graphics graphics) { 
        graphics.clear();
        graphics.setColor(Color.BLACK); 
        graphics.setBackgroundColor(Color.ORANGE); graphics.fillRect(0, 0,0, 0); 
        super.paint(graphics); 
    } 
}; 

Try to modify this like the following:

lF1= new LabelField("state editions",LabelField.FIELD_LEFT |FIELD_VCENTER) {
    public void paint(Graphics graphics) {             
        super.paint(graphics); 
    } 
}; 

That means, you don't have to extend default LabelField.

Just use,

lF1= new LabelField("state editions",LabelField.FIELD_LEFT |FIELD_VCENTER);

And check the Graphics , graphics.clear() etc in the API.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top