Я хочу разместить рекламный баннер сети Facebook Audience под веб-представлением. Я не хочу, чтобы реклама перекрывала мой веб-просмотр. Я не смог реализовать это в течение нескольких дней.
Вот мой файл макета, в котором я разместил рекламу после веб-просмотра в ограниченном макете.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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"
android:id="@+id/web_view_relative_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/activity_main">
<View
android:id="@+id/divider"
android:layout_width="0dp"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
app:layout_constraintTop_toTopOf="parent" />
<WebView
android:id="@+id/web_view_documentation"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RelativeLayout
android:id="@+id/native_banner_ad_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" />
</android.support.constraint.ConstraintLayout>
Я разместил AppBarLayout над веб-просмотром. Если я добавлю ограничения, мой веб-просмотр начнет перекрываться панелью приложения.
Высота и ширина моего веб-просмотра установлены на match_parent. Я хочу, чтобы мой веб-просмотр занимал все пространство, оставшееся после объявления. Таким образом, в основном, если мое объявление имеет высоту 100dp, веб-просмотр должен заполнять оставшееся пространство без перекрытия или перекрытия. Заранее спасибо.