Use of subpaint() on Mainscreen Doesn't paint child correctly

强颜欢笑 提交于 2019-12-11 10:53:10

问题


To get a quick background of the problem please refer to Create Transparent Mainscreen in Blackberry .

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.

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.

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.

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.

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..?

  • Big O

回答1:


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);
    }
}

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.



来源:https://stackoverflow.com/questions/6902007/use-of-subpaint-on-mainscreen-doesnt-paint-child-correctly

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!