lundi 29 décembre 2014

how to load page in Webview android

i've got an android webview app, that shows my website, i want to know if is there a way to control the loading state of the page, and put a "Loading..." script for every html page in the webview, and i also have 2 problem, when i start my app, it shows for about 4-5 seconds a black screen and the other one is that when my webview is loaded it doesn't load in correct way the webpage, but when i reload, it works correctly. Thank you guys


This is my website "home page"



<!doctype html>
<html>
<head>


<meta charset="utf-8">
<title>Eventi</title>
<link rel="stylesheet" type="text/css" href="CSS/stile.css">
<script src="JS/jquery-1.11.1.js.js"></script>
<script src="JS/func.js"></script>
<?php include ("PHP/phpfiles.php");?>


</head>

<body>

<div id="navigation">
<a href="eventi.php"> <div align="left" style="float:left;margin-left: 5%; margin-top:-1.5%;"><img src="IMG/reload.png" width="30" height="30" alt=""/></div> </a>
<a href="#" style="margin-left:-5.3%;"><img src="IMG/logo_navbar.png" width="300" height="30" alt="Logo" class="logonavig"/></a>
<div align="right" style="float:right;margin-right: 5%;"><img src="IMG/undo.png" width="10" height="11" alt=""/></div>
</div>

<!--
<? if ($_SESSION['FBID']): ?>
<p class="testobparty"><font color="#000000" > Benvenuto/a &nbsp; </font> <font color="#1D49A2" size="5px" style="font-weight:bold;"><? echo $_SESSION['FULLNAME']; ?></font></p>
<? else: ?>
<p class="testobparty"> <a href="LOGIN/1353/fbconfig.php" style="text-decoration:underline; color:#1D49A2; font-weight:bold; font-family:Impact, Haettenschweiler, 'Franklin Gothic Bold', 'Arial Black', sans-serif;"><img src="IMG/buttonfb3.png" height="40" width="300"> </a></p>
<? endif ?> --> <br> <br> <br>
</div>
</div>

<? inserisci_div(); ?>









<div id="footer"> © - 2014 <font color="#FFF">BParty by BParty Staff</font> All rights reserved | <a href="http://www.ask.fm/BPartyOfficial">ASK.FM</a> | <a href="https://www.facebook.com/people/BParty-Profilo/100007646898561">FACEBOOK</a> | <br> Icon made by <a href="http://www.icons8.com" title="Icons8"><font style="font-weight:200">Icons8</font></a> from <a href="http://www.flaticon.com" title="Flaticon"><font style="font-weight:200">http://www.flaticon.com</font></a> is licensed under <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0"><font style="font-weight:200">CC BY 3.0</font></a>
</div>




</body>
</html>


i think that the problem is my JS file



$(document).ready( function(){
if ($(window).width() > 1001 && $(window).width() < 10000 )
{
$("#menubar").css("font-size", ((($(window).height()*8)/100)));
$(".fotoevento").css("height", ((($(window).height()*45)/100)));
$(".fotoevento").css("width", ((($(window).height()*100)/100)));
$(".pub").css("margin-left", ((($(window).height()*13)/100)));
$(".testievento").css("font-size", ((($(window).width()*3)/100)));
$("#footer").css("font-size", ((($(window).width()*3)/100)));


//MOBILE
$(".logonavig").css("height", ((($(window).height()*3)/100)));
$(".logonavig").css("width", ((($(window).width()*19)/100)));

}



else if ($(window).width() < 1000)
{
$("#menubar").css("font-size", ((($(window).height()*3)/100)));
$(".fotoevento").css("height", ((($(window).height()*35)/100)));
$(".fotoevento").css("width", ((($(window).width()*90)/100)));
$(".pub").css("margin-left", ((($(window).height()*13)/100)));
$(".testievento").css("font-size", ((($(window).width()*5)/100)));
$(".imamgineeventocompleta").css("margin-top", ((($(window).height()*9)/100)));
$("#footer").css("font-size", ((($(window).width()*2.4)/100)));


//MOBILE
$(".logonavig").css("height", ((($(window).height()*3)/100)));
$(".logonavig").css("width", ((($(window).width()*47)/100)));


}

else {
$("#menubar").css("font-size", ((($(window).height()*3)/100)));
$(".fotoevento").css("height", ((($(window).height()*60)/100)));
$(".fotoevento").css("width", ((($(window).height()*110)/100)));
$(".pub").css("margin-left", ((($(window).height()*60)/100)));
$(".testievento").css("font-size", ((($(window).width()*5)/100)));

//MOBILE
$(".logonavig").css("height", ((($(window).height()*3)/100)));
$(".logonavig").css("width", ((($(window).width()*35)/100)));
}




Aucun commentaire:

Enregistrer un commentaire