Basically I am trying to recreate the default contact screen when you click on "+" button another row of Phone number added to the list.
Right now I have an ImageView as the "+" button and a ListView to contain the list of phone numbers. The problem is that the ListView doesn't expand when I add more item into the list.
I could build the same look with LinearLayout but how can I save all those numbers that way?
Below is the layout of the item that will be inflate with custom Adapter
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="60px"
android:stretchColumns="1"
android:background="#FFFFFFFF"
android:gravity="center_vertical">
<TableRow>
<Button
android:id="@+id/type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Home" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
>
<EditText
android:id="@+id/value"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:text=""
android:hint="Name"
android:lines="1"
android:textSize="10pt"
android:typeface="sans"
android:textColor="#FF000000"
android:gravity="left"
/>
</RelativeLayout>
<ImageView
android:id="@+id/del"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:paddingRight="14dp"
android:src="@android:drawable/ic_delete" />
</TableRow>
</TableLayout>
This is the ListView portion.
<ListView
android:id="@+id/phoneList"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FFFFFFFF"
android:scrollbars="none" />
This is really confusing :S. Could anyone help me please?