<LinearLayout
android:id="@+id/linID"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="20dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="50dp"
android:layout_marginBottom="40dp">
<TextView
android:layout_width="fill_parent"
android:layout_height="37dp"
android:background="@color/transparentBlack"
android:clickable="false"
android:id="@+id/gHeader"
android:textSize="22dp"
android:textColor="@color/homeCategoryTitleColor"/>
<ListView android:id="@id/android:list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:headerDividersEnabled="false"
android:drawSelectorOnTop="true"
android:choiceMode="singleChoice"
android:clickable="false"
android:divider="@color/categorylist_divider"
android:dividerHeight="20.0sp"
android:layout_below="@+id/gHeader"
android:scrollbarSize="10dp"
android:fadeScrollbars="false"/>
<ImageView
android:layout_width="fill_parent"
android:layout_height="20dp"
android:background="@color/transparentBlack"
android_layout_below="@+id/android:list"
android:src="@drawable/down_arrow" />
</LinearLayout>
這就是我到目前爲止的情況。 listview中的數據動態添加,出於某種原因,imageview始終位於屏幕的底部,除非listview將所有內容填滿,這顯示正常。有想法該怎麼解決這個嗎?我嘗試了多種方式,將佈局包裹起來以結合其他佈局來解決問題,但無法獲得創意。提前致謝!在列表視圖下方添加圖片
'android_layout_below'只適用於RelativeLayout,並且使用'@ + id',除非你是**添加**一個id。引用時只能使用'@ id'。 –
@Taeyoung李沒有得到你想要的?請參閱這裏它可能會幫助你: - http://coderzpassion.com/android-working-linearlayout/ –
@jagjitsingh我想在listview下面添加圖像頁腳。我已經在listview上實現了imageview,但似乎無法弄清楚如何在它下面添加。有一個空間,我認爲它來自我在列表視圖上設置的高度。有任何想法嗎? –