I have a problem that, I want to add a textView or a button at the bottom of the gridview. But I am failed to achieve this, I had tried a linearlayout after the gridview in the xml but there was not a successful attempt. Please help me regarding to this problem that I want a textview in the bottom of the gridview.
My XML is:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:pax="http://schemas.android.com/apk/res/com.shopzilla.android.common"
android:layout_width="fill_parent"
android:orientation="vertical"
android:layout_height="fill_parent" android:id="@+id/main_Linear_Layout" android:background="#ffffff">
<LinearLayout android:layout_width="match_parent" android:background="#191970" android:layout_height="50dip" android:id="@+id/linear_Header_Layout">
<ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/img_logo" android:layout_marginLeft="20dip" android:layout_marginTop="10dip" android:src="@drawable/bizratelogo2"></ImageView>
<Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dip" android:background="@drawable/list_view_icon" android:layout_marginLeft="20dip" android:id="@+id/btn_searchresult_list"></Button>
<Button android:layout_width="wrap_content" android:id="@+id/btn_RefineSearch" android:textSize="15dip" android:layout_height="wrap_content" android:background="@drawable/refine_search_btn" android:layout_marginTop="10dip"></Button>
</LinearLayout>
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/linear_Layout_Search" android:background="@drawable/bluebg">
<EditText android:layout_marginTop="5dip" android:layout_marginBottom="5dip" android:layout_width="300dip" android:layout_height="30dip" android:background="@drawable/search_bar_bg" android:layout_marginLeft="7dip" android:paddingLeft="30dip" android:id="@+id/txt_search_grid" android:singleLine="true" android:clickable="true" android:focusable="false"></EditText>
</LinearLayout>
<LinearLayout android:layout_width="fill_parent" android:id="@+id/linear_Header_Layout" android:orientation="vertical" android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/linear_load"
android:layout_width="fill_parent"
android:background="#E4E4E4" android:layout_height="265dip">
<GridView
android:layout_width="fill_parent"
android:columnWidth="90dp"
android:numColumns="auto_fit"
android:horizontalSpacing="10dp"
android:stretchMode="columnWidth"
android:gravity="center"
android:layout_height="wrap_content"
android:id="@+id/Search_Result_Grid" android:background="#E4E4E4" android:focusable="true" android:verticalSpacing="10dp">
</GridView>
</LinearLayout>
<LinearLayout
android:id="@+id/linear_load"
android:layout_width="fill_parent"
android:layout_height="35dip">
<TextView
android:id="@+id/lbl_load"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Load More" android:textSize="18dip" android:layout_gravity="center" android:layout_marginLeft="115dip"></TextView>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:id="@+id/widget3"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
>
<com.shopzilla.android.common.Toolbar
android:layout_width="fill_parent"
pax:tab_id="tab1" android:layout_height="wrap_content" android:layout_gravity="bottom"/>
</LinearLayout>
</LinearLayout>
Put the
TextViewinside theGridViewtag.–
UPDATE :
You have in your XML this structure:
Make it looks like this:
Make sure that:
layout_width="fill_parent"layout_width="wrap_content"layout_width="wrap_content"Good Luck !