列表视图底部的Textview不会显示为listview添加更多项目?

时间:2014-03-07 04:33:02

标签: android

在我的第一个屏幕截图中,您可以在顶部看到已放置的列表视图,并且在已放置的列表视图旁边的下方看到textview。 但是如果你看看我的第二个屏幕截图,因为列表视图添加了更多项目,底部的textview位置不会出现。

screen 1 screen 2

我的布局代码是:

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

  <LinearLayout
    android:id="@+id/relativeLayout1"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >
      <Spinner             
        android:layout_height="wrap_content"         
         android:layout_width="0dip"  
         android:layout_weight="2"                              
        android:id="@+id/spinnerSemester" />          

       <Button
            android:id="@+id/graph_button"
            android:layout_width="0dip"
           android:layout_weight="0.7"
            android:layout_height="wrap_content"                
            android:text="Chart" />
 </LinearLayout>

 <ExpandableListView
    android:id="@+id/lv_attendance"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_weight="1"
    android:cacheColorHint="#00000000"
    >
</ExpandableListView>

    <TextView
            android:id="@+id/TV_note"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/lv_attendance"
            android:paddingLeft="10dp"
            android:text="[NOTE : The data displayed here is for advance information only. Please check with the college office/department concerned for the final and certified data. In case of discrepancies, the data maintained in the college records will be deemed to be the final one.]"
            android:layout_marginTop="10px"
            android:textSize="13sp" />
</LinearLayout>

谢谢, Nandakishore P

3 个答案:

答案 0 :(得分:1)

尝试如下......

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/form_view"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <LinearLayout
        android:id="@+id/relativeLayout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <Spinner
            android:id="@+id/spinnerSemester"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="2" />

        <Button
            android:id="@+id/graph_button"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="0.7"
            android:text="Chart" />
    </LinearLayout>

    <ExpandableListView
        android:id="@+id/lv_attendance"
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:cacheColorHint="#00000000" >
    </ExpandableListView>

    <TextView
        android:id="@+id/TV_note"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dip"
        android:paddingLeft="10dp"
        android:text="[NOTE : The data displayed here is for advance information only. Please check with the college office/department concerned for the final and certified data. In case of discrepancies, the data maintained in the college records will be deemed to be the final one.]"
        android:textSize="13sp" />

</LinearLayout>

答案 1 :(得分:0)

考虑为视图指定android:layout_weight,同时在framelayout或linearlayout中包含该文本视图

上帝,我讨厌布局...

答案 2 :(得分:0)

不要使用android:layout_below =“@ + id / lv_attendance”,它的创建问题,请改用alignParentBottom。