2017-03-25 7 views
0

相対レイアウトでボタンとテキストビューフィールドが重なるAdmob広告に問題があります。入力テキストフィールドとボタン領域の下にどのようにして取得できますか?相対レイアウトオーバーラップボタンでadmobを追加

<RelativeLayout 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:paddingBottom="0dp" 
    android:paddingLeft="0dp" 
    android:paddingRight="0dp" 
    android:paddingTop="0dp" 
    tools:context=".Chat_Room"> 
    <EditText 
     android:id="@+id/room_name_edittext" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentStart="true" 
     android:layout_toLeftOf="@+id/btn_add_room" 
     android:layout_toStartOf="@+id/btn_add_room"/> 

    <Button 
     android:id="@+id/btn_add_room" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentEnd="true" 
     android:layout_alignParentRight="true" 
     android:text="Select group above"/> 

    <ListView 
     android:id="@+id/listView" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_above="@+id/room_name_edittext" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentStart="true" 
     android:layout_alignParentTop="true"/> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="fill_parent" 
     android:gravity="bottom" 
     android:orientation="horizontal" 
     android:layout_above="@+id/btn_add_room" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentStart="true"> 

    </LinearLayout> 

    <com.google.android.gms.ads.AdView 
     android:id="@+id/add" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="bottom" 
     android:layout_weight="1" 
     ads:adSize="BANNER" 
     ads:adUnitId="@string/banner_ad_unit_id" 
     android:layout_alignParentBottom="true" 
     android:layout_centerHorizontal="true"> 
    </com.google.android.gms.ads.AdView> 

</RelativeLayout> 

テキストとボタンの編集画面の下に表示されるadviewの下にはどうすればよいですか?

答えて

1

は、あなたのボタンにこれを追加します。android:layout_above="@+id/add"

および削除:android:layout_alignParentBottom="true"

<Button 
    android:id="@+id/btn_add_room" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_above="@+id/add" 
    android:layout_alignParentEnd="true" 
    android:layout_alignParentRight="true" 
    android:layout_marginBottom="5dp" 
    android:text="Select group above" /> 
+0

おかげで多くのことを... –

関連する問題