2009-07-10 9 views
1

Je veux "réparer" l'arrière-plan alors que seul le ListField défile.Blackberry Custom Arrière-plan de VFM défile avec listfield?

Problème actuel:

alt text

Scrolling vers le bas (la boîte surounding doit se déplacer avec la liste)

alt text

code correspondant pour le VerticalFieldManager

VerticalFieldManager _bottom_box = new VerticalFieldManager(Field.FIELD_HCENTER | Field.FIELD_VCENTER | VerticalFieldManager.VERTICAL_SCROLL | Field.USE_ALL_HEIGHT) 
     { 
      protected void sublayout(int maxWidth, int maxHeight) 
      { 
       super.sublayout(maxWidth, maxHeight); 
       setExtent(maxWidth - 6, maxHeight - 3); 
      } 
      protected void paint(Graphics graphics) 
      { 
       graphics.clear(); 
       graphics.setColor(Color.WHITE); 
       graphics.fillRect(0, 0, (this.getWidth()), (this.getHeight())); 
       graphics.setColor(color_computacenter_light_blue); 
       graphics.drawRect(0, 0, (this.getWidth()), (this.getHeight())); 
       super.paint(graphics); 
      } 
     }; 

Toutes les idées, comment résoudre ce problème? Merci

Répondre

2

Il est un peu difficile de savoir sans plus d'informations sur la structure de cet écran, mais la cause première est la différence entre la hauteur visible à l'écran (donnée par getHeight()) et la hauteur virtuelle. Vous dessinez vers la fenêtre virtuelle avec cette méthode de peinture, donc je pense que ce réglage devrait corriger les choses:

    protected void paint(Graphics graphics) 
        { 
          graphics.clear(); 
          graphics.setColor(Color.WHITE); 
          graphics.fillRect(0, graphics.getClippingRect().y, (this.getWidth()), (this.getHeight())); 
          graphics.setColor(color_computacenter_light_blue); 
          graphics.drawRect(0, graphics.getClippingRect().y, (this.getWidth()), (this.getHeight())); 
          super.paint(graphics); 
        } 
+0

Bonjour, Anthony * g. Vous semblez être le seul spécialiste blackberry sur stackoverflow.com. Comme vous pouvez le voir, mon projet évolue. –

+0

Correction: Simple, il suffit de mettre un autre VFM autour de la ListField :) –

+0

coldice semble être un régulier BB ici aussi bien :) –