Android 底部的AdMob横幅-将Linearlayout转换为RelativeLayout
我对安卓相当陌生。我试图在应用程序底部添加admob横幅,实际上是在其中两个活动中。我认为线性布局不是正确的方式Android 底部的AdMob横幅-将Linearlayout转换为RelativeLayout,android,xml,android-layout,admob,adbannerview,Android,Xml,Android Layout,Admob,Adbannerview,我对安卓相当陌生。我试图在应用程序底部添加admob横幅,实际上是在其中两个活动中。我认为线性布局不是正确的方式 所以请帮助我将Linearlayout转换为RelativeLayout 此外,在运行应用程序时,只有activity_entry.xml示例google横幅显示。view_home.xml横幅只显示静态空白 如何使横幅智能化?我的意思是,我希望它只在需要显示横幅时才显示,而不是作为静态空白 activity_entry.xml view_home.xml 以下是一些获得你
view_home.xml
以下是一些获得你想要的东西的提示: 在这里查看如何使其成为relativelayout: 基本上,关键代码是
android:layout_alignParentBottom="true"
如果布局有帮助,可以嵌套布局。。。或者不是
第二部分:考虑使用AdistEnter并使用OnReleDead()和OnFruteDeCeEVEAd()动态布局版式。 在这里查看adListener的一些要点:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:showIn="@layout/activity_home"
android:weightSum="1">
<include layout="@layout/view_toolbar"/>
<fragment
android:id="@+id/entries_list_fragment"
android:name="net.etuldan.sparss.fragment.EntriesListFragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="SMART_BANNER"
ads:adUnitId="ca-app-pub-3940256099942544/6300978111"
android:layout_gravity="center_horizontal">
</com.google.android.gms.ads.AdView>
android:layout_alignParentBottom="true"