在列表中添加“卡”

时间:2015-02-12 14:05:13

标签: android listview android-fragments include scrollview

我有一个问题......我需要在滚动视图中添加一个以上的xml ...片段的xml是这个

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#D9DADE"
    android:gravity="center"
    android:orientation="vertical" >

<include
    android:id="@+id/intestazione"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    layout="@layout/dettaglio_richiesta"
    android:background="@drawable/selector_card_background"
    android:padding="15dp" />
    
 <include
    android:id="@+id/note"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    layout="@layout/dettaglio_note"
    android:background="@drawable/selector_card_background"
    android:padding="15dp" 
    />   


  <include
    android:id="@+id/articoli"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    layout="@layout/dettaglio_articoli"
    android:background="@drawable/selector_card_background"
    android:padding="15dp" />   
 
 <include
    android:id="@+id/preventivi"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    layout="@layout/dettaglio_preventivi"
    android:background="@drawable/selector_card_background"
    android:padding="15dp" />  
    
 <include
    android:id="@+id/tragitto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    layout="@layout/dettaglio_tragitto"
    android:background="@drawable/selector_card_background"
    android:padding="15dp" />

		<TextView
		    android:id="@+id/TestCard"
		    android:layout_width="match_parent"
		    android:layout_height="wrap_content"
		    android:layout_marginBottom="10dp"
		    android:layout_marginLeft="15dp"
		    android:layout_marginRight="15dp"
		    android:layout_marginTop="10dp"
		    android:background="@drawable/selector_card_background"
		    android:gravity="center"
		    android:padding="15dp"
		    android:text="FINE DELLE CARD" />

</LinearLayout>

    

</ScrollView>

例如,如果我有更多的Preventivi项目,这是一个xml导入并填充一次加载,我该怎么办? 怎么可以插入更多......

`

<include
        android:id="@+id/preventivi"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        layout="@layout/dettaglio_preventivi"
        android:background="@drawable/selector_card_background"
        android:padding="15dp" />

`

所以我可以在父xml中看到多张卡片? 谢谢你的帮助! :)

0 个答案:

没有答案