2011-02-04 1 views
0

J'ai généré le code comme ci-dessous, mais le bouton de réinitialisation n'affiche pas entre les boutons de départ et de fin. Quelqu'un m'aider à afficher le bouton de réinitialisation?J'ai généré le code comme ci-dessous, mais le bouton de réinitialisation n'affiche pas entre les boutons de début et de fin

Merci à l'avance

final BitmapField mybitmapresetField = new BitmapField(Bitmap.getBitmapResource("res/images/start_button.png"),FOCUSABLE); 
protected void sublayout(int maxWidth, int maxHeight) { 

       layoutChild(mybitmapstartField, maxWidth, maxHeight); 
       setPositionChild(mybitmapstartField, 140, 0); 
       layoutChild(mybitmapresetField, maxWidth, maxHeight); 
       setPositionChild(mybitmapresetField, 0, 0); 

       layoutChild(mybitmapfinishField, maxWidth, maxHeight); 
       setPositionChild(mybitmapfinishField, 280, 0); 
       layoutChild(mybitmaplogoField, maxWidth, maxHeight); 
       setPositionChild(mybitmaplogoField, 20, 440); 

       layoutChild(mybitmaphowtoField, maxWidth, maxHeight); 
       setPositionChild(mybitmaphowtoField, 140, 440); 
       layoutChild(mybitmapm1Field, maxWidth, maxHeight); 
       setPositionChild(mybitmapm1Field, 190, 60); 
       layoutChild(mybitmapleftyrField, maxWidth, maxHeight); 
       setPositionChild(mybitmapleftyrField, 120, 100); 
       layoutChild(mybitmaprightyrField, maxWidth, maxHeight); 
       setPositionChild(mybitmaprightyrField, 280, 100); 
       layoutChild(backgroundBitmapbar1, maxWidth, maxHeight); 
       setPositionChild(backgroundBitmapbar1, 10, 140); 
       layoutChild(backgroundBitmapbar2, maxWidth, maxHeight); 
       setPositionChild(backgroundBitmapbar2, 10, 180); 
       layoutChild(backgroundBitmapbar3, maxWidth, maxHeight); 
       setPositionChild(backgroundBitmapbar3, 10, 220); 
       layoutChild(backgroundBitmapbar4, maxWidth, maxHeight); 
       setPositionChild(backgroundBitmapbar4, 10, 260); 
       layoutChild(backgroundBitmapbar5, maxWidth, maxHeight); 
       setPositionChild(backgroundBitmapbar5, 10, 300); 
       layoutChild(backgroundBitmapbar6, maxWidth, maxHeight); 
       setPositionChild(backgroundBitmapbar6, 10, 340); 

       layoutChild(timerCount , maxWidth, maxHeight); 
       setPositionChild(timerCount , 274, 443); 
       setExtent(Display.getWidth(),Display.getHeight()); 

      } 

     }; 
     _vfm.add(mybitmapstartField) ; 

     _vfm.add(mybitmapresetField) ; 
     _vfm.add(mybitmapfinishField) ; 
     _vfm.add(mybitmaplogoField) ; 
     _vfm.add(mybitmapm1Field) ; 
     _vfm.add(mybitmapleftyrField) ; 
     _vfm.add(mybitmaprightyrField) ; 
     _vfm.add(mybitmaphowtoField) ; 
     _vfm.add(timerCount) ; 
     _vfm.add(backgroundBitmapbar1) ; 

     _vfm.add(backgroundBitmapbar2) ; 
     _vfm.add(backgroundBitmapbar3) ; 
     _vfm.add(backgroundBitmapbar4) ; 
     _vfm.add(backgroundBitmapbar5) ; 
     _vfm.add(backgroundBitmapbar6) ; 

    this.add(_vfm); 
    } 

Répondre

1

Vous appelez setPositionChild avec 0 coordonnées pour le champ de remise à zéro, une 140 coordonnées pour la zone de départ, et 280 coordonnées pour le champ d'arrivée. Vous devez définir la coordonnée du champ à quelque chose entre 140 et 280, ou bien changer les autres coordonnées.

+0

Aucun problème. Ne pas oublier d'accepter des réponses valides aux questions que vous posez ... –

+0

je veux construire ma demande en prenant un champ de liste, dans ce champ de liste je veux mettre 12 images et 12 texte. Mais je ne sais pas comment utiliser listfield Alors, plz, aidez-moi comment développer le champ liste, donnez-moi un exemple de code pour mettre en œuvre – gdk

+0

j'ai développé une application avec champ de liste, dans le champ de liste j'ai ajouté 12 lignes, dans chaque colonne theare 7 fields.my problème est il n'est pas défilement, peut-on m'aider – gdk

Questions connexes