Comment charger un contenu html avec une hauteur et une largeur fixes dans un affichage Web Android dont la hauteur et la largeur sont définies sur wrap_content? Ceci est ma page HTML i.e label.html chargement à partir des actifs.Webview ajoutant un espace blanc sur le côté droit
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style>
@charset "utf-8";
/* CSS Document */
.Main{
width:50%;
height:200px;
border: 1px solid #09ED1C;
float:left;
background-color:#00F3FF;
}
H1{
color:#FC1D21;
}
</style>
</head>
<body>
<div class="Main" align="center">
<h1>This page is created using internal CSS</h1>
</div>
</body>
</html>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/blue">
<WebView
android:id="@+id/wv_help"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
WebSettings webSettings = mWebViewHelp.getSettings();
webSettings.setJavaScriptEnabled(true);
mWebViewHelp.setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);
mWebViewHelp.loadUrl("file:///android_asset/label.html");
Ceci est l'ajout d'espace blanc sur le côté droit de WebView même si son wrap_content, WebView.SCROLLBARS_INSIDE_OVERLAY est pas non plus de résoudre mon problème, toute aide serait appréciée.
https: // stackoverflow.com/questions/1991219/webview-wrap-content –
pourquoi vous définissez la largeur de la page html 50% – akhilesh0707
html la hauteur et la largeur de la page provoquent des problèmes remove width: 50%; hauteur: 200px; ' – akhilesh0707