【发布时间】:2010-11-18 10:31:21
【问题描述】:
我想在具有爱丽丝蓝色背景的 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 右对齐。
有人知道解决这个问题的方法吗?
【问题讨论】:
标签: user-interface blackberry background-color