Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android webview has white border around it and how can i get rid of it?

I have a android app using a webview to load a webpage, however in the graphical layout and in the app it shows a white thick border, I tried resizing and I tried changing the width and height in the XML layout file, but no change. Please check the below image for reference.

enter image description here

like image 345
Ryan Kelly Avatar asked Mar 29 '13 22:03

Ryan Kelly


People also ask

How do I close Webview on Android?

Add a close button and on its click set: webview. setVisibility(View. INVISIBLE); webview.


2 Answers

Try to modify your HTML content like this:

<body style='margin:0;padding:0;'>
like image 136
Barry Zhang Avatar answered Sep 19 '22 00:09

Barry Zhang


This seems to work for me:

String frameString = "<html><body style='margin:0;padding:0;'><iframe src=\"http://k-video.com/\" height=\"410\" width=\"320\" frameborder=\"0\" allowfullscreen></iframe></body></html>";

Hope it helps !

like image 33
Marcos Avatar answered Sep 20 '22 00:09

Marcos