我想在具有爱丽丝蓝色背景的 MainScreen 上放置几个带有右对齐文本的 LabelField。不幸的是,我似乎无法弄清楚如何做到这一点。
我能做的最好的就是在 MainScreen 上将我的背景设置为 Color.ALICEBLUE 并将 LabelFields 放置在屏幕上(也具有爱丽丝蓝色背景)。
public void paint(Graphics graphics) {
graphics.setBackgroundColor(Color.ALICEBLUE);
graphics.clear();
super.paint(graphics);
}
和...
LabelField display = new LabelField("", LabelField.FIELD_RIGHT){
public void paint(Graphics graphics) {
graphics.setColor(Color.DIMGRAY);
graphics.setBackgroundColor(Color.ALICEBLUE);
graphics.clear();
super.paint(graphics);
}
};
覆盖 MainScreen 绘制例程给了我爱丽丝蓝色背景,但覆盖 LabelFields 的绘制例程似乎还不够。结果是一个白色行,仅在标签文本后面有一个爱丽丝蓝色背景。添加USE_ALL_WIDTH
更正了背景问题,但我无法与USE_ALL_WIDTH
.
有谁知道解决这个问题?