這個想法是把admob橫幅放在屏幕的底部,我用android:layout_alignParentBottom = "true"
試過,但橫幅站在它佔據的地方的中間。目前看起來是這樣的:pic1我想是這樣的:pic2adMob |底部的智能橫幅?
我的代碼:
<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>
oh..try不同高度 – GvSharma 2014-09-29 08:46:51
什麼身高設定? – GabrielAtan 2014-09-29 09:14:56
com.google.android.gms.ads.AdView中的layout _height屬性。 – GvSharma 2014-09-29 09:16:01