Ajouter par programmation des points de Vue à l'intérieur d'un (Linéaire)Mise en page (qui est à l'intérieur d'un ScrollView)

J'ai une application qui, après quelques clic, montre une activité avec de nouvelles matières. Je veux au fond de la que pour afficher les commentaires, qui sont chargés dynamiquement dans async task.

Une approche consiste à utiliser ListView et personnalisé ArrayAdapter, mais, je dois mettre ListView à l'intérieur d'un ScrollView, et c'est un problème, même si je remplacer manuellement ListView de la hauteur. Il nous montre un élément de la liste, et une partie de la suivante.

L'autre approche consiste à définir LinearLayout comme un support pour les commentaires, que gonfler un autre LinearLayouts défini dans son propre fichier xml, le remplir du contenu, de l'attacher à un titulaire de vue. Il fonctionne très bien, à partir du programme de point de vue, sauf qu'il pousse les commentaires ci-dessous contenu de la news. C'est comme, il en crée une autre déroulante afficher de commentaires en dessous de contenu od news (contenu de chevauchement).

Est-il un autre moyen de faire ce qui n'a rien à voir avec les listes, ou comment puis-je faire autre approche du travail.

Pertinentes de l'extrait de code de mise en page xml qui contient de nouvelles matières est:

<LinearLayout> //global layout
    <LinearLayout>
        //views that hold title, date, content
    </LinearLayout>      

        <LinearLayout 
           android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:id="@+id/commentsHolder"
            android:orientation="vertical">

        <View 
            android:layout_width="fill_parent"
            android:layout_height="2dp"
            android:background="#ed1b24"/>
        <TextView 
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:text="KOMENTARI"
            android:layout_marginLeft="5dp"/>
        <View 
            android:layout_width="fill_parent"
            android:layout_height="1dp"
            android:background="#ed1b24"/>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="0dip"
            android:orientation="vertical"
            android:id="@+id/comments_holder_view"
            android:layout_weight="1">
        </LinearLayout>


    </LinearLayout>

</LinearLayout>

et le code qui correspond à un commentaire est:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/comments_holder_item"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="5dp">

<TextView 
    android:id="@+id/comment_content"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/comments_back_details"
    android:text="Ovde ide tekst komentara, koji se, naravno, dinamicki dodaje."/>

<LinearLayout 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <TextView 
        android:id="@+id/comment_author"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        style="@style/categoryStyle"
        />

    <TextView 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text=" | "
        style="@style/categoryStyle"
        />

    <TextView 
        android:id="@+id/comment_pubdate"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        style="@style/categoryStyle"/>

</LinearLayout>

<LinearLayout 
    android:layout_width="fill_parent"
    android:layout_height="1dp"
    android:orientation="horizontal"
    android:layout_margin="5dp"
    android:background="#d1d1d1">
</LinearLayout>

Merci beaucoup pour toute réponse. C'est assez important pour moi.

OriginalL'auteur Dimmy3 | 2012-03-28