框架下方的Adview

雅克·克劳斯(Jacques Krause)

我正在Fragments从主要活动中进行切换目前,我正在AdView从每个活动中调用一个新的活动Fragment但我只想AdView从显示所有活动的主活动中调用一个新活动Fragments

现在,我只需要知道如何使AdView不在内部显示,FrameLayout因为现在它阻止了底部的内容。

那么,如何才能获得内容的AdView外部/下方FrameLayout

content_main.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
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"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".activity.MainActivity"
tools:showIn="@layout/app_bar_main">


<FrameLayout
    android:id="@+id/mainFrame"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

</FrameLayout>

<RelativeLayout

    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/mainFrame">

    <com.google.android.gms.ads.AdView
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="15dp"
        android:layout_gravity="center"
        ads:adSize="BANNER"
        ads:adUnitId="@string/banner_ad_unit_id">
    </com.google.android.gms.ads.AdView>

</RelativeLayout>

</RelativeLayout>
杰伊·拉索德(Jay Rathod RJ)

仅将singleRelative Layout用作Root Layout,然后android:layout_above="@+id/adView"在中使用Frame Layout

这是xml代码

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <FrameLayout
        android:id="@+id/frameLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/adView"
        android:background="@mipmap/ic_launcher" />

    <com.google.android.gms.ads.AdView
        android:id="@+id/adView"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_alignParentBottom="true" />

</RelativeLayout>

在此处输入图片说明

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

SubView的框架下移

来自分类Dev

聚合框架下mongodb中的$ count

来自分类Dev

机器人框架下载文件

来自分类Dev

在codeigniter框架下使用oauth 2构建保护我的API

来自分类Dev

使用Microsoft bot框架下载文件(pdf / image)

来自分类Dev

在开发工具->资源->框架下获取可用元素

来自分类Dev

在不同版本的Play框架下开发和运行

来自分类Dev

在开发工具->资源->框架下获取可用的元素

来自分类Dev

TheIntern测试框架下加载Dojo AMD模块失败

来自分类Dev

在Play框架下处理致命错误的正确方法

来自分类Dev

无法在iPhone的A帧框架下播放视频纹理

来自分类Dev

如何在pandas框架下减少最长字符串的数据?

来自分类Dev

有没有什么办法可以在ABP框架下的ApplicationInitialization中使用AddSingleton?

来自分类Dev

如何使用ASP.NET MVC 5和实体框架下载MP3文件

来自分类Dev

将框架布局放置在ConstraintLayout的工具栏下方

来自分类Dev

如何在框架的左下方添加JProgress Bar

来自分类Dev

如何在框架布局中彼此下方显示按钮?

来自分类Dev

完全删除AdView

来自分类Dev

隐藏和显示Adview

来自分类Dev

Android AdView NoClassDefFoundError

来自分类Dev

NullPointerException销毁AdView

来自分类Dev

隐藏和显示Adview

来自分类Dev

AdView Admob错误

来自分类Dev

未显示本机Express AdView

来自分类Dev

实施adView时最主动

来自分类Dev

关闭屏幕的 RelativeLayout 内的 AdView

来自分类Dev

AdView 中未显示广告

来自分类Dev

列表项下方/下方的CSS边框

来自分类Dev

列表项下方/下方的CSS边框