Good day, I have an Activity which contains 4 fragments. The Activity has a footer which I use to switch between these fragment views. Now in one of my fragments, i have some widgets and the last widget is a ListView. The trouble am having is, the last 2 entries in the Listview are not displaying correctly! they are obscured by the footer. I have set my LayoutParameters for both the width and height of the Listview to FILL_PARENT. but its not working. Any idea how i can solve this? Thanks in advance.
My Layout is :
for the fragment:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button android:id="@+id/line_button_id" android:layout_width="160dp"
android:layout_height="wrap_content" android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" android:layout_marginLeft="5dp" android:focusable="true"
android:layout_marginTop="8dp" android:text="@string/line_graph" android:background="@drawable/temp_left_button" />
<Button android:id="@+id/bar_button_id" android:layout_width="160dp"
android:layout_height="wrap_content" android:layout_alignBaseline="@+id/line_button_id"
android:layout_alignBottom="@+id/line_button_id" android:focusable="true"
android:layout_alignParentRight="true" android:layout_marginRight="5dp"
android:text="@string/bar_graph" android:background="@drawable/temp_right_button"></Button>"
<FrameLayout
android:id="@+id/graph_framelayout_id"
android:layout_width="fill_parent"
android:layout_height="280dp"
android:layout_below="@id/line_button_id"
android:padding="4dp"
android:layout_margin="4dp"
android:background="@drawable/rounded_date_filter">
</FrameLayout>
<!-- first cell information, dashboard -->
<LinearLayout
android:id="@+id/row1_id"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:layout_below="@id/graph_framelayout_id"
android:orientation="horizontal"
android:clickable="true"
android:background="@drawable/rounded_table_row">
<TextView
android:id="@+id/dashboard_datefrom_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:layout_marginLeft="20dp"
android:text="01 may 2012"/>
<ImageView
android:id="@+id/dashboard_image_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/ic_action_search"/>
<TextView
android:id="@+id/dashboard_dateto_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:text="01 sept 2012"/>
</LinearLayout>
<!-- accounts overview listview -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/row1_id"
android:layout_margin="4dp"
android:orientation="vertical"
android:background="@drawable/rounded_date_filter">
<TextView
android:id="@+id/list_text_header_id"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="2dp"
android:text="@string/data_grid_text_header_day"
android:background="@drawable/text_header">
</TextView>
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ListView>
</LinearLayout>
</RelativeLayout>
and for the Activity i have this:
<
?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@+id/fragment_container_id"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</FrameLayout>
<include layout="@layout/footer"></include>"
</RelativeLayout>
i replace the fragments with in the framelayout of the Activity
What Layout are you using in your Fragment, this surely won’t happen if you use RelativeLayout and set above attribute to your ListView like this :
Try to add this into FrameLayout in your Activity layout.