问题描述
要快速了解问题的背景,请参阅在Blackberry中创建透明主屏幕
To get a quick background of the problem please refer toCreate Transparent Mainscreen in Blackberry.
我面临的问题是主屏幕上孩子的绘画.我希望主屏幕看起来像透明/半透明,这是原始要求,并添加其他UI元素,例如经理/最重要的领域.
The problem I am facing is with painting of the child on mainscreen.I wanted my mainscreen to look transparent/translucent as an original requirement and add my other UI elements e.g. managers/field on top of it.
所以我正在使用的UI元素是3个BitmapField,应该使用BorderFactory.createSimpleBorder()创建其粗边框,并为Field.VISUAL_STATE_FOCUS和Field.VISUAL_STATE_NORMAL状态添加两种颜色.所有这些BitmapFields都添加到它们各自的HorizontalFieldManger中,然后又添加到屏幕中.
So the UI elements I am using are 3 BitmapField(s) which should have its thick border created using BorderFactory.createSimpleBorder() with two colors added for Field.VISUAL_STATE_FOCUS and Field.VISUAL_STATE_NORMAL states. all of these BitmapFields are added in their respective HorizontalFieldManger which in turn are added to the screen.
因此,部分问题是,当我在这些BitmapFields上进行导航时,添加到BitmapFields中的边框的某些区域"不会按照指定的状态(正常,焦点)绘制.
So part of the problem is, when I do navigation across these BitmapFields, "some area" of the border added to the BitmapFields doesn't get painted as per the state (normal, focus) specified.
另一个问题是,在割炬9800上,当我从上到下浏览时,反之亦然,我看到默认滚动发生了,这应该是正常的,但是在每次滚动时,当在滚动.
Other problem is, on torch 9800 when I navigate across from top to bottom or vice versa, i see default scroll happening which should be normal however on each scroll my BitmapField leaves some tail/crack on the screen when movement happened on the scrolling.
当我使用普通屏幕(不使用subpaint来使屏幕透明)时,这些事情都不会发生.
None of such things happen when I use normal screen (not use subpaint to make the screen transparent).
你知道这里发生了什么吗??
Do you have any idea what's happening here..?
- 大O
推荐答案
YMMV,但是我用以下方法制作了透明屏幕:
YMMV, but I've made a transparent screen with this:
public class TranslucentScreen extends Screen {
public TranslucentScreen() {
super(new VerticalFieldManager(USE_ALL_WIDTH | NO_VERTICAL_SCROLL));
setBackground(BackgroundFactory.createSolidTransparentBackground(0x000000, 150));
}
protected void sublayout(int width, int height) {
setPosition(0, 0);
setExtent(width, height);
setPositionDelegate(0, 0);
layoutDelegate(width, height);
}
}
这是我制作的基本弹出屏幕屏幕,具有半透明的黑色背景.我在屏幕上添加了VerticalFieldManager来控制背景绘画,这正是我想要的方式,然后在其中添加其他Fields.
This was for a basic popup screen screen I made that had a semi-transparent black background. I added a VerticalFieldManager to the screen that I controlled the background painting on so it would be how I wanted it, and then added my other Fields to that.
这篇关于在主屏幕上使用subpaint()不能正确绘制子级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!