开发者

Blackberry DateField onfocus color

开发者 https://www.devze.com 2023-01-11 04:46 出处:网络
I have adateField and when I iterate with the cursor over the various sub sections (date month year, etc) of the dateField the focus color by default is blue. When I unfocus the dateField the item tha

I have a dateField and when I iterate with the cursor over the various sub sections (date month year, etc) of the dateField the focus color by default is blue. When I unfocus the dateField the item that was selected highlight turns white. Which is fine, except my text is white with a bla开发者_如何学Cck background. This makes it look poor as now there is a date field with one of the sub fields looking like a white rectangle.

I tried painting the the background black which solved the blue/white highlight, but it did so by offering no highlight at all. So you can no longer tell when you have focus on the field.

Is there a way to override the highlight colors for the sub parts of a dateField?


Found a workaround finally. Whenever it tries to draw white I change to black then reset the normal blue for when it highlights again.

public void paint(Graphics g)
        {   
            if(g.getBackgroundColor() == Color.WHITE) { 
                g.setBackgroundColor(Color.BLACK);
                g.clear();
                g.setBackgroundColor(Color.BLUE);
            }
            g.setColor(Color.WHITE - HistoricalBottomBar.BG_COLOR);
            super.paint(g);
        }
0

精彩评论

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