I am loading some HTML content in WebView but its always coming in the top left corner of my WebView.
I have tried to use stylesheet also, in stylesheet I have added
try this:
<html>
<head>
<style type="text/css">
@font-face { font-family: MyCustomFont;
src:url("~/android_asset/fonts/MyriadPro-Regular.otf") }
#text{ font-family: MyCustomFont;
font-size:14;
text-align: center;
margin:350px;
line-height: normal;
color:blue;
height:20px;
width:100px;
margin:auto;
background-color:red;
}
</style>
</head>
<body>
<p id="text"> Hello World</p>
</body>
</html>
And I think that your address source font is mistake!
<WebView android:id="@+id/webview1"
android:layout_gravity="center"
android:scaleType="centerInside"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:adjustViewBounds="true">
it might help you.