Fixed footer not displaying the bottom-most list item

前端 未结 1 407
小鲜肉
小鲜肉 2021-01-23 17:44

Here is my XML layout:




        
相关标签:
1条回答
  • 2021-01-23 18:27

    I just found out how. By utilizing the RelativeLayout and by changing the code to this:

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/root"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    
        <LinearLayout
           android:id="@+id/listview_footer"
           android:layout_height="wrap_content"
           android:layout_width="fill_parent"
           android:layout_alignParentBottom="true">
           <EditText
               android:id="@+id/new_task_title"
               android:layout_height="wrap_content"
               android:layout_width="fill_parent" 
               android:layout_weight="1"
               android:hint="Add a new task" />
           <Button
               android:id="@+id/new_task_button"
               android:layout_height="wrap_content"
               android:layout_width="fill_parent"
               android:layout_weight="3"
               android:text="+" />
        </LinearLayout>
    
        <ListView
            android:id="@android:id/list" 
            android:orientation="vertical"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content"
            android:layout_below="@id/root"
            android:layout_above="@id/listview_footer">
        </ListView>
    </RelativeLayout>
    
    0 讨论(0)
提交回复
热议问题