Reputation: 595
I would like to know the possibilities to create a button after Listview without assiging any hardcore value to its height.
What happened is my button gets overlapped by the Listview when the no of rows exceeds say 14 or 15.For my layout mostly i'm using LinearLayout as i feel little comfortable with it.
Here i'm attaching my layout's xml snippet and the image.Please have a look and leave your comments and way to get rid of the above mentioned situation.
Thanks in advace guys.
layout xml file(Snippet)
<HorizontalScrollView
android:id="@+id/scroll_full"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/invScanType" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/lay_fullTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:background="#000000"
android:orientation="horizontal"
>
<TextView
style="@style/textRegular_list"
android:layout_width="105dp"
android:layout_height="wrap_content"
android:text="@string/itemno"
android:textStyle="bold" >
</TextView>
<TextView
style="@style/textRegular_list"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="@string/description"
android:textStyle="bold" >
</TextView>
<TextView
style="@style/textRegular_list"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="@string/pick_seq"
android:textStyle="bold" >
</TextView>
<TextView
style="@style/textRegular_list"
android:layout_width="105dp"
android:layout_height="wrap_content"
android:text="@string/mseordqty"
android:textStyle="bold" >
</TextView>
<TextView
style="@style/textRegular_list"
android:layout_width="105dp"
android:layout_height="wrap_content"
android:text="@string/mseshpqty"
android:textStyle="bold" >
</TextView>
<TextView
style="@style/textRegular_list"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="@string/uom"
android:textStyle="bold" >
</TextView>
<TextView
style="@style/textRegular_list"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="@string/mseshipvia"
android:textStyle="bold" >
</TextView>
<TextView
style="@style/textRegular_list"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:text="@string/msecomments"
android:textStyle="bold" >
</TextView>
</LinearLayout>
<ListView
android:id="@+id/lst_msefull"
style="@style/ListViewAppTheme.White"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
</ListView>
</LinearLayout>
</HorizontalScrollView>
<LinearLayout
android:id="@+id/lay_mse"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="16dp"
android:gravity="center_horizontal"
android:orientation="horizontal" >
<Button
android:id="@+id/btn_mseExit"
style="@style/ButtonAppTheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/action_exit_in" />
</LinearLayout>
Layout image
Here i'want to restrict my Listview height so that button doesn't Overlapped when Listview content is big.
Upvotes: 1
Views: 42
Reputation: 13029
Wrap everything in a vertical LinearLayout
.
Set the height
of the HorizontalScrollView
to 0dp
and the weight
to 1
.
Upvotes: 1