Here’s a layout of my Activity XML:

For some reason I can’t see that button t the bottom of my screen.
Here’s the code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/app_bg"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_transparent"
android:orientation="vertical"
android:minHeight="44dip"
android:minWidth="44dip" >
<TextView
android:id="@+id/lblNotesCount"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="@color/lblNotesCountColor" />
<TextView
android:id="@+id/lblTxtNotes"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="@color/lblNotesCountColor" />
</LinearLayout>
<TextView
android:id="@+id/txtActivityListByCategory_Header"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center_vertical|center_horizontal"
android:paddingLeft="2dp"
android:singleLine="true"
android:textStyle="bold"
android:textColor="@color/color_WHITE" />
<Button
android:id="@+id/btnAddNote"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_new_note_selector"
android:minHeight="44dip"
android:minWidth="44dip" />
</LinearLayout>
<TextView
android:id="@+id/emptyList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="2dp"
android:text="@string/txtEmptyList"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/emptyList" />
<ListView
android:id="@+id/lstNotesByCategory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawSelectorOnTop="false" >
</ListView>
<Button
android:id="@+id/btnaBack"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/btnBack" />
I tried to put the bottom TextView and ListView in a separate LinearLayout, I tried to give that button a layout_weight – nothing helped, I still don’t see that button, the LinearLayout goes till the bottom of the activity.
What is wrong here? Why don’t I see that button?
EDIT: Wrote down the entire XML code
Make your ListView’s
android:layout_height="0dp"andandroid:layout_weight="1"Like this:
This will make your ListView expand vertically till the borders of your Button.
Hope this helps