Ensemble expandablelistview de l'élément de hauteur par programmation

J'ai un expandablelistview et j'ai mis un arrière-plan de l'élément groupes, mais je voudrais ajuster la hauteur. J'ai déjà réglé la hauteur dans un fichier xml (50dp) mais ça ne fonctionne pas (la vraie hauteur n'est pas 50 dp, mais il est plus grand), donc je pense le faire par programmation.

Ensemble expandablelistview de l'élément de hauteur par programmation

Ici vous avez un morceau de mon code pour l'expliquer

grouplayout_index.xml

<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      android:id="@+id/LinearLayout_index"
      android:background="@drawable/bg_capitolo_retina"
      android:paddingBottom="10dp"
      android:paddingTop="10dp"
      android:layout_height="50dp"             ---------------------//height = 50 dp
      android:layout_marginTop="10dp"
      android:layout_marginBottom="10dp"
      android:layout_width="match_parent" >

    <ImageView android:id="@+id/freccia_indice" android:src="@drawable/freccia_o"
        android:clickable="false"
        android:layout_height="28dp"
        android:layout_width="28dp"
        android:layout_marginTop="5dp"
        android:layout_marginBottom="10dp" 
        android:focusable="false"
        android:focusableInTouchMode="false"
        android:paddingLeft="10dp"  />

    <TextView android:id="@+id/tvGroup"  
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_marginTop="10dp"
        android:paddingLeft="50dp" />
</LinearLayout> 

Index.java

  public class Index extends  ExpandableListActivity {
        .....
           IndexAdapter   mAdapter = new IndexAdapter .....
          explistview.setAdapter(mAdapter);
}

IndexAdapter.java

   public class IndexAdapter  extends BaseExpandableListAdapter{

     ....various methods......
   public View getGroupView(int groupPosition, boolean isExpanded, View  convertView,ViewGroup parent) {

    if (convertView == null) {
            LayoutInflater infalInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
             convertView =   infalInflater.inflate(R.layout.grouplayout_index, null);

    }      
         TextView textView = (TextView) convertView.findViewById(R.id.tvGroup);
         textView.setTextAppearance(context, R.style.textViewStyleGroup);
         textView.setText("textview");

            /* I have tried this code but it doesn't works.
           LinearLayout ll = (LinearLayout)   convertView.findViewById(R.id.LinearLayout_indice);
           ll.setLayoutParams(new LinearLayout.LayoutParams(30,50));
*/              
   }

Quelqu'un peut m'aider, s'il vous plaît?

InformationsquelleAutor sleone08 | 2012-05-16