0

I have a Horizontal manager having 3 label fields shown has "1:00 Event1" in the screen ,i want to set background color for hfm only covering 1:00 ,how can i do this ?

HorizontalFieldManager horizontalFieldManager_left15 = new HorizontalFieldManager(
                Manager.HORIZONTAL_SCROLL);

        horizontalFieldManager_left15.add(time15Label);
        horizontalFieldManager_left15.add(min15Label);

         horizontalFieldManager_left15.add(evetnLabel);

Thanks

4

1 回答 1

1

参考这个 -

HorizontalFieldManager horizontalFieldManager_left15 = new HorizontalFieldManager(
            Manager.HORIZONTAL_SCROLL);

LabelField lb = new LabelField(time15Label)  {

//设置文本的背景颜色

protected void paint(Graphics graphics) {
         graphics.setColor(Color.LAVENDAR);
            super.paint(graphics);
        }
    };

//设置TextArea的backgroundColor

 protected void paintBackground(Graphics graphics) {
         graphics.setBackgroundColor(Color.GOLDENROD);
         graphics.clear();
        }
    };



   horizontalFieldManager_left15.add(time15Label);
于 2012-06-08T13:37:26.323 回答