开发者

Touch screen keyboard not displaying correctly

开发者 https://www.devze.com 2023-03-08 17:29 出处:网络
When the user hovers over editfield below the touch screen keyboard does not display. What is displayed is a white area that is same size as keyboard. This is an issue on BlackBerry Torch. I would exp

When the user hovers over editfield below the touch screen keyboard does not display. What is displayed is a white area that is same size as keyboard. This is an issue on BlackBerry Torch. I would expect the touch screen keyboard to appear correctly using below code ?

BasicEditField nameField = 
    new BasicEditField(
        "  "+Local.getInfo8()+ " : ", "", 100, BasicEditField.FILTER_DEFAULT)
    {
        private int iRectX = getFont().getAdvance(getLabel());
        private int iRectWidth = backgroundButtonBitmap.getWidth() - iRectX - 4;
        public int getPreferredHeight() {
            return backgroundButtonBitmap.getHeight() / 2;
        }

        public void layout(int width, int height) {
            //setExtent(width, getPrefer开发者_如何学编程redHeight());
            super.layout(width, getPreferredHeight());
        }

        public void paint(Graphics g) {
            g.setColor(Color.BLACK);
            g.setBackgroundColor(Color.WHITE);
            //g.drawRect(iRectX, 0, iRectWidth, 20);
            super.paint(g);
        }
    };


On the display screen, the method sublayout was being overriden -

protected void sublayout( int maxWidth, int maxHeight ) {

super.sublayout( maxWidth, maxHeight );
setExtent(maxWidth,Constants.BACKGROUND_IMAGE.getHeight());  

}

The line - setExtent(maxWidth,Constants.BACKGROUND_IMAGE.getHeight()); is causing the issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号