Friday, 21 June 2019

How to display AdView in Bottom with RecyclerView in Xml

Here we design a Layout to display Adview  with RecyclerView 



Select  layouts right click on it Select New and Create Layout resource file. give file name like as you wish here i m giving home.xml and here i share xml  Layout  file code to set Adview at bottom with Recyclerview. here you can take any control as you wish.

home.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adbhome"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="@string/ads_banner">
</com.google.android.gms.ads.AdView>
<android.support.v7.widget.RecyclerView
android:id="@+id/mrecycle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/adbhome"
android:layout_alignParentTop="true" />
</RelativeLayout>

No comments:

Post a Comment

Comments

Find Hours Diffrence in Kotlin

  In Kotlin, determining the difference in hours between two timestamps is a common task, especially in scenarios involving time-based calcu...