m0nsta
m0nsta

Reputation: 27

Android Studio: Webview - white space at bottom

In my app there is a white bar at the bottom. I've looked at other questions and they told me to make sure I have everything set to match_parent. I did that and nothing worked.

Picture: https://i.sstatic.net/MYaOJ.png

Any help would be appreciated.

fragment_main.xml

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

<LinearLayout
    android:id="@+id/container_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <android.support.v4.widget.SwipeRefreshLayout
        android:id="@+id/container_swipe_refresh"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1">

        <WebView
            android:id="@+id/fragment_main_webview"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/global_bg_front" />

    </android.support.v4.widget.SwipeRefreshLayout>

    <com.google.android.gms.ads.AdView
        android:id="@+id/fragment_main_adview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        app:adUnitId="@string/admob_unit_id"
        app:adSize="BANNER" />

</LinearLayout>

<include
    layout="@layout/placeholder_progress"
    android:id="@+id/container_progress"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="gone" />

<include
    layout="@layout/placeholder_offline"
    android:id="@+id/container_offline"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="gone" />

<include
    layout="@layout/placeholder_empty"
    android:id="@+id/container_empty"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="gone" />

activity_main.xml

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

<include layout="@layout/toolbar" />

<android.support.v4.widget.DrawerLayout
    android:id="@+id/activity_main_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

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

    <ListView
        android:id="@+id/activity_main_drawer"
        android:layout_width="@dimen/drawer_width"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:choiceMode="singleChoice"
        android:drawSelectorOnTop="true"
        android:fastScrollEnabled="false"
        android:listSelector="@drawable/selector_clickable_item_bg"
        android:background="@color/global_bg_front" />

</android.support.v4.widget.DrawerLayout>

Upvotes: 0

Views: 554

Answers (1)

Damian Kozlak
Damian Kozlak

Reputation: 7083

Isn't this bar because of wrongly displayed ads in layout? Did you try to remove it? If bar disappear, it means that there is a problem with displaying ads.

<com.google.android.gms.ads.AdView
    android:id="@+id/fragment_main_adview"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    app:adUnitId="@string/admob_unit_id"
    app:adSize="BANNER" />

Upvotes: 1

Related Questions