0
J'essaye de placer l'admob au fond de ma disposition. J'ai FrameLayouts dans un LinearLayout. Mais je ne peux pas bouger admob au fond, c'est toujours au top. J'ai essayé de définir la valeur layout_gravity en bas sur admob FrameLayout mais ce n'était pas le travail. Comment puis-je gérer cela? Merci pour les conseils.FrameLayout au fond (Android)
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<FrameLayout
android:id="@+id/admob"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@+id/all"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:id="@+id/game"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/road_back"
android:layout_width="498dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:contentDescription="@null"
android:scaleType="fitXY"
android:src="@drawable/road" />
<ImageView
android:id="@+id/road0"
android:layout_width="498dp"
android:layout_height="340dp"
android:layout_gravity="center"
android:contentDescription="@null"
android:scaleType="fitXY"
android:src="@drawable/road" />
<ImageView
android:id="@+id/road1"
android:layout_width="498dp"
android:layout_height="340dp"
android:layout_gravity="center|top"
android:contentDescription="@null"
android:scaleType="fitXY"
android:src="@drawable/road" />
<ImageView
android:id="@+id/road2"
android:layout_width="498dp"
android:layout_height="340dp"
android:layout_gravity="center|bottom"
android:contentDescription="@null"
android:scaleType="fitXY"
android:src="@drawable/road" />
<ImageView
android:id="@+id/time0"
android:layout_width="20dp"
android:layout_height="24dp"
android:layout_gravity="center"
android:layout_marginBottom="150dp"
android:layout_marginRight="52dp"
android:contentDescription="@null"
android:src="@drawable/time" />
<ImageView
android:id="@+id/time1"
android:layout_width="20dp"
android:layout_height="24dp"
android:layout_gravity="center"
android:layout_marginBottom="150dp"
android:contentDescription="@null"
android:src="@drawable/time" />
<ImageView
android:id="@+id/time2"
android:layout_width="20dp"
android:layout_height="24dp"
android:layout_gravity="center"
android:layout_marginBottom="150dp"
android:layout_marginLeft="52dp"
android:contentDescription="@null"
android:src="@drawable/time" />
<ImageView
android:id="@+id/coin0"
android:layout_width="20dp"
android:layout_height="24dp"
android:layout_gravity="center"
android:layout_marginBottom="100dp"
android:layout_marginRight="52dp"
android:contentDescription="@null"
android:src="@drawable/coin" />
<ImageView
android:id="@+id/coin1"
android:layout_width="20dp"
android:layout_height="24dp"
android:layout_gravity="center"
android:layout_marginBottom="100dp"
android:contentDescription="@null"
android:src="@drawable/coin" />
<ImageView
android:id="@+id/coin2"
android:layout_width="20dp"
android:layout_height="24dp"
android:layout_gravity="center"
android:layout_marginBottom="100dp"
android:layout_marginLeft="52dp"
android:contentDescription="@null"
android:src="@drawable/coin" />
<ImageView
android:id="@+id/hero"
android:layout_width="32dp"
android:layout_height="55dp"
android:layout_gravity="center|bottom"
android:layout_marginBottom="100dp"
android:contentDescription="@null"
android:src="@drawable/car_hero" />
<ImageView
android:id="@+id/car0"
android:layout_width="32dp"
android:layout_height="70dp"
android:layout_gravity="center"
android:layout_marginRight="52dp"
android:contentDescription="@null"
android:src="@drawable/car0" />
<ImageView
android:id="@+id/car1"
android:layout_width="32dp"
android:layout_height="70dp"
android:layout_gravity="center"
android:contentDescription="@null"
android:src="@drawable/car1" />
<ImageView
android:id="@+id/car2"
android:layout_width="32dp"
android:layout_height="70dp"
android:layout_gravity="center"
android:layout_marginLeft="52dp"
android:contentDescription="@null"
android:src="@drawable/car2" />
<ImageView
android:id="@+id/explode"
android:layout_width="150dp"
android:layout_height="150dp"
android:contentDescription="@null"
android:scaleType="fitXY"
android:src="@drawable/explode" />
<TextView
android:id="@+id/txt_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="7dp"
android:alpha="0.3"
android:lines="1"
android:textColor="#000"
android:textSize="30sp"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/controls"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false"
android:orientation="horizontal" >
<LinearLayout
android:id="@+id/btn_left"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:clickable="true"
android:gravity="bottom|center" >
<ImageView
android:id="@+id/arrow_left"
android:layout_width="80dp"
android:layout_height="80dp"
android:contentDescription="@null"
android:src="@drawable/btn_left" />
</LinearLayout>
<LinearLayout
android:id="@+id/btn_break"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:clickable="true"
android:gravity="bottom|center" >
<ImageView
android:id="@+id/arrow_break"
android:layout_width="80dp"
android:layout_height="80dp"
android:contentDescription="@null"
android:src="@drawable/btn_break" />
</LinearLayout>
<LinearLayout
android:id="@+id/btn_right"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:clickable="true"
android:gravity="bottom|center" >
<ImageView
android:id="@+id/arrow_right"
android:layout_width="80dp"
android:layout_height="80dp"
android:contentDescription="@null"
android:src="@drawable/btn_right" />
</LinearLayout>
</LinearLayout>
<ToggleButton
android:id="@+id/btn_play"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="top|right"
android:layout_margin="7dp"
android:background="@drawable/btn_play"
android:onClick="onClick"
android:textOff=""
android:textOn="" />
<TextView
android:id="@+id/mess"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:alpha="0.5"
android:background="#000"
android:gravity="center"
android:lines="1"
android:padding="10dp"
android:text="@string/game_over"
android:textColor="#FFF"
android:textSize="30sp"
android:textStyle="bold"
android:visibility="gone" />
</FrameLayout>
<FrameLayout
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@null"
android:scaleType="centerCrop"
android:src="@drawable/bg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="20dp" >
<Button
android:id="@+id/btn_sign"
style="@style/Button"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:onClick="onClick"
android:text="@string/btn_sign_in" />
<Button
android:id="@+id/btn_leaderboard"
style="@style/Button"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:onClick="onClick"
android:text="@string/btn_leaderboard" />
<ImageView
android:id="@+id/logo"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:contentDescription="@null"
android:src="@drawable/logo" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal" >
<Button
android:id="@+id/btn_sound"
style="@style/Button"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.8"
android:onClick="onClick"
android:text="@string/btn_mute"
android:textSize="18sp" />
<Button
android:id="@+id/btn_start"
style="@style/Button"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_weight="1"
android:background="@drawable/btn_start"
android:onClick="onClick"
android:text="@string/btn_start"
android:textColor="#FFF"
android:textSize="22sp" />
<Button
android:id="@+id/btn_exit"
style="@style/Button"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.8"
android:onClick="onClick"
android:text="@string/btn_exit"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
<FrameLayout
android:id="@+id/result"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" >
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@null"
android:scaleType="centerCrop"
android:src="@drawable/bg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="20dp" >
<TextView
android:id="@+id/txt_result"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.2"
android:gravity="bottom|center"
android:shadowColor="#000"
android:shadowDx="1"
android:shadowDy="2"
android:shadowRadius="1"
android:text="@string/score"
android:textColor="#FFF"
android:textSize="50sp"
android:textStyle="bold" />
<TextView
android:id="@+id/txt_high_result"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.8"
android:gravity="top|center"
android:shadowColor="#000"
android:shadowDx="1"
android:shadowDy="2"
android:shadowRadius="1"
android:text="@string/high_score"
android:textColor="#f7f974"
android:textSize="25sp"
android:textStyle="bold" />
<Button
android:id="@+id/btn_home"
style="@style/Button"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:onClick="onClick"
android:text="@string/btn_home" />
<Button
android:id="@+id/btn_start2"
style="@style/Button"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="20dp"
android:layout_weight="1"
android:background="@drawable/btn_start"
android:onClick="onClick"
android:text="@string/btn_start2"
android:textColor="#FFF" />
</LinearLayout>
</FrameLayout>
</FrameLayout>
</LinearLayout>