简体   繁体   English

LinearLayout底部的Adview标语涵盖了Android中的图像按钮

[英]Adview Banner at bottom of LinearLayout covers imagebuttons in Android

i want AdView to be displayed at the bottom of the screen but it hiding the imagebuttons, I set gravity as bottom as well as layout-gravity as bottom even-though there is no luck for me. 我希望AdView显示在屏幕的底部,但它隐藏了图像按钮,我将重力设置为底部,将布局重力设置为底部,尽管对我而言没有任何运气。 Please help 请帮忙

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/grey">
    <TextView
        android:layout_width="wrap_content"
        android:textColor="@color/colorPrimaryDark"
        android:textSize="40dp"
        android:textStyle="bold"
        android:text="@string/end"
        android:layout_height="wrap_content"
        android:layout_gravity="center"/>
    <TextView
        android:layout_width="wrap_content"
        android:textColor="@color/colorPrimaryDark"
        android:textSize="18dp"
        android:textStyle="bold"
        android:text="@string/end2"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginTop="30dp"/>
    <com.mindorks.placeholderview.SwipePlaceHolderView
        android:id="@+id/swipeView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
    <LinearLayout
        android:id="@+id/ll10"
        android:layout_alignParentTop="true"
        android:layout_above="@+id/adView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:gravity="center"
        android:orientation="horizontal" >
        <ImageButton
            android:id="@+id/rejectBtn"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:background="@drawable/ic_skip"/>
        <ImageButton
            android:id="@+id/viewBtn"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_marginLeft="50dp"
            android:background="@drawable/ic_view"/>
        <ImageButton
            android:id="@+id/acceptBtn"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_marginLeft="50dp"
            android:background="@drawable/ic_heart"/>
    </LinearLayout>
    <com.google.android.gms.ads.AdView
        android:id="@+id/adView02"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_below="@id/ll10"
        android:layout_centerHorizontal="true"
        android:layout_gravity="bottom"
        ads:adSize="SMART_BANNER"
        ads:adUnitId="@string/banner_ad_unit_id02">
    </com.google.android.gms.ads.AdView>
</FrameLayout>

Thanks in advance. 提前致谢。

I just fix it by adding relativelayout: 我只是通过添加relativelayout来解决它:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

<FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

 <com.google.android.gms.ads.AdView
        android:id="@+id/adView02"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        ads:adSize="SMART_BANNER"
        ads:adUnitId="@string/banner_ad_unit_id"></com.google.android.gms.ads.AdView>

</RelativeLayout>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM