No se puede colocar la vista debajo de RecyclerView
Tengo problemas para colocar unAdview
debajo de unRecyclerView
. Actualmente elRecyclerView
está ocupando el resto del diseño y elAdview
no se muestra Ninguna de las soluciones que he encontrado en línea ha resuelto mi problema. Generalmentelayout_weight
olayout_below
resuelve el problema pero no es en este caso.
XML
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:ads="http://schemas.android.com/apk/res-auto"
tools:context=".MainActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#7c7c7c"
android:focusable="true"
android:focusableInTouchMode="true">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/relContainer"
android:background="@drawable/bordershadow2"
android:paddingBottom="17dp"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="10dp" />
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/recycler_view"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-3940256099942544/6300978111">
</com.google.android.gms.ads.AdView>
<RelativeLayout
android:id="@+id/relContainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bordershadow"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">
<TableLayout
android:id="@+id/purchaseTableLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="7dp"
android:paddingTop="7dp"
android:layout_alignParentTop="true"
android:stretchColumns="0,1,2">
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:weightSum="3">
<TextView
android:id="@+id/textView1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="2dp"
android:singleLine="true"
android:textColor="#000"
android:textSize="24sp"
android:textStyle="bold" />
<TextView
android:id="@+id/textView2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="2dp"
android:singleLine="true"
android:textColor="#000"
android:textSize="24sp"
android:textStyle="bold" />
<Spinner
android:id="@+id/typeSpinner"
style="style/Theme.Material"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:entries="@array/type_array"
android:textSize="@dimen/title_size" />
</TableRow>
</TableLayout>
<EditText
android:id="@+id/searchEditText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="@+id/purchaseTableLayout"
android:digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'() "
android:hint="Search"
android:imeOptions="actionDone"
android:singleLine="true" />
<TableLayout
android:id="@+id/tableLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/searchEditText"
android:paddingBottom="7dp"
android:paddingTop="7dp"
android:stretchColumns="0,1,2">
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:weightSum="3.0">
<Spinner
android:id="@+id/sortRaceSpinner"
style="style/Theme.Material"
android:paddingTop="5dp"
android:paddingBottom="10dp"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.0"
android:entries="@array/sort_race_array"
android:textSize="@dimen/title_size" />
<Spinner
android:id="@+id/sortAffinitySpinner"
style="style/Theme.Material"
android:paddingTop="5dp"
android:paddingBottom="10dp"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.0"
android:entries="@array/sort_affinity_array"
android:textSize="@dimen/title_size" />
<Spinner
android:id="@+id/sortSpinner"
style="style/Theme.Material"
android:paddingTop="5dp"
android:paddingBottom="10dp"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.0"
android:entries="@array/sort_array"
android:textSize="@dimen/title_size" />
</TableRow>
</TableLayout>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>