Comment faire pour afficher plusieurs TextViews à l'intérieur de chaque ligne dans la ListView?

Je suis entrain de créer une page d'Aide en qui j'ai une série de questions et de réponses. Ces questions et réponses ont des styles différents. Voici le fichier xml qui décrit la disposition d'un de questions & réponses:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"
              android:layout_gravity="center">
    <TextView
            android:text="@string/Help_first_question"
            android:id="@+id/text1"
            android:padding="5dip"
            android:background="#e0f3ff"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"/>
    <LinearLayout
            android:id="@+id/panel1"
            android:visibility="gone"
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content">
        <TextView
                android:layout_margin="2dip"
                android:text="@string/Help_first_answer"
                android:padding="5dip"
                android:background="#FFFFFF"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"/>
    </LinearLayout>
</LinearLayout>

Je veux afficher plusieurs questions et réponses dans un listView, dans lequel chaque ligne contient un ensemble de la question et la réponse. Mon listview ressemble :

    <ListView xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/listview"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content" >  
    </ListView>

de sorte qu'il ressemble :

first row  :  Q
              A
second row :  Q
              A
third row  :  Q
              A 

Quelle est la meilleure approche pour atteindre cet objectif?

mettre en œuvre un adaptateur personnalisé
Créer une mise en page personnalisée que vous le souhaitez et de les lier dans un adpter à l'aide de l'adaptateur personnalisé. Et afficher les données dans ListView à l'aide CustomAdapter classe.

OriginalL'auteur Anshul | 2013-12-24