1

I am trying to add banner ad in my android app. but the banner loaded from webview showed with space or margin. I didn't specified margin anywhere.

Ad space for image is specified 300 x 50 means anything bigger than this go out of focus.

If this space is displayed in webview then image will be displayed partially or cropped from bottom and sides.

This is Image added directly.

enter image description here

This is Image added from webview.

enter image description here

any solution to avoid these margins because I can't customize fixed 300 x 50 fixed size of ad space.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >
     <WebView
        android:id="@+id/webview1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/bann" /> 

</RelativeLayout>

Ad space is 300 x 50. I can't illustrate it here in layout.. Its added by adserver SDK.

Straw Hat
  • 902
  • 14
  • 38

1 Answers1

2

Very likely there's a default margin/padding in the html page you show, please check this post to get the solution: Remove unwanted White Space in WebView Android

Community
  • 1
  • 1
fasteque
  • 4,309
  • 8
  • 38
  • 50