Впервые я разрабатываю приложение для Android, и пока оно идет очень хорошо, за исключением одной вещи. Я сделал макет веб-просмотра, и я хотел показывать рекламу в приложении. Поэтому я добавил рекламу AdMob, и они работают очень хорошо. Но есть одна проблема.
AdMob покрывает часть WebView, поэтому он не смещает макет WebView вверх, а покрывает его. И это раздражает, потому что вы не можете прочитать часть текста веб-просмотра. Как я могу это исправить?
Это мой файл main.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent" android:id="@+id/rltvLayout01"
android:layout_height="fill_parent" android:background="@color/white">
<ScrollView android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<WebView android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:scrollbars="none" />
</ScrollView>
<LinearLayout android:id="@+id/ad_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:layout_alignParentBottom="true">
<com.google.ads.AdView android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adUnitId="helloworldcode"
ads:loadAdOnCreate="true"
ads:adSize="BANNER" />
</LinearLayout>
</RelativeLayout>
Я попытался дать ScrollView android:layout_above="@+id/ad_layout"
, но затем приложение закрылось ... Так что я действительно надеюсь, что кто-нибудь может мне помочь, поскольку я ищу его часами: (