这个想法是将admob横幅放在我尝试过的屏幕底部,android:layout_alignParentBottom = "true"
但横幅站在它占据的位置的中间。目前看起来像这样:pic1我想看起来像这样:pic2
我的代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background"
android:orientation="vertical"
tools:context="eu.gabrielatanasov.demoViewer.Home_activity" >
<LinearLayout
android:id="@+id/homeContentLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >
应用程序在这里
</LinearLayout>
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_below="@id/homeContentLayout"
ads:adSize="SMART_BANNER"
ads:adUnitId="@string/adMob_ID" >
</com.google.android.gms.ads.AdView>
</RelativeLayout>