您能否在标签颜色上发送任何示例代码,默认情况下它会显示黑色我希望在UI中更改外观颜色请帮助我..
感谢你
答案 0 :(得分:2)
你可以这样做
LabelField label = new LabelField("label"){
protected void paintBackground(Graphics g) {
g.setBackgroundColor(Color.BLUE);
g.clear();
super.paintBackground(g);
}
};
或者像这样
LabelField label = new LabelField("label"){
protected void paint(Graphics g) {
int oldColor = g.getColor();
g.setColor(Color.BLUE);
g.fillRoundRect(0, 0, getWidth(), getHeight(), 7, 7);
g.setColor(oldColor);
super.paint(g);
}
};