2017-08-02 4 views
-6

Ceci est mon code mon adaptateur me renvoie une vue Modifier le texte à mon activitéandroid editText est imprime pas mon entrée donnée à ce

public View getView(int i, View view, ViewGroup viewGroup) { 
      LinearLayout linearLayout; 
      linearLayout = new LinearLayout(context); 
      linearLayout.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); 
      linearLayout.setOrientation(LinearLayout.VERTICAL); 
      EditText editText = new EditText(context); 
      editText.setMinLines(1); 
      linearLayout.addView(editText); 
      return linearLayout; 
    } 
+0

S'il vous plaît préciser votre problème ou ajouter des détails supplémentaires pour mettre en évidence exactement ce dont vous avez besoin. Comme c'est écrit actuellement, il est difficile de dire exactement ce que vous demandez. Voir la page Comment demander pour obtenir de l'aide pour clarifier cette question. – Akshay

Répondre

0

Utilisez ce que je pense que ce peut être un travail ...

LinearLayout.LayoutParams param = new LinearLayout.LayoutParams 
         (LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT, 1f); 

oU essayer ....

public View getView(int i, View view, ViewGroup viewGroup) { 
      LinearLayout linearLayout; 
      linearLayout = new LinearLayout(context); 
     LinearLayout.LayoutParams param = new LinearLayout.LayoutParams 
        (LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT, 1f); 

      linearLayout.setOrientation(LinearLayout.VERTICAL); 
      EditText editText = new EditText(context); 
      editText.setMinLines(1); 
      editText.setLayoutParams(params); 

      linearLayout.addView(editText); 
      return linearLayout; 
    }