Phonegap (3.2) 앱을 쓰고 있습니다. HTML5 캔버스를 사용하여 전체 화면으로 만들고 전체 앱 UI가이 캔버스에 있습니다.PhoneGap 앱 화면 해상도
삼성 갤럭시 S4 (Android 4.3)를 사용하여 앱을 테스트하면 앱의 화면 해상도는 내가 원하는 것처럼 360X640이며 1080X1920이 아닙니다.
가능한 최대 화면 해상도를 사용하기 위해 수행해야 할 작업은 무엇입니까? // 확인을하지만 나쁜 해상도
을 보이는내가 추가 한 스크린 샷 1)
windowWidth = window.innerWidth; windowHeight = window.innerHeight; 화면의 작은 부분을 취하고 //
2)의 나머지 부분은 흰색
windowWidth = window.outerWidth; windowHeight = window.outerHeight;
3) // 이미지가 1080X1920 인 것처럼 보이지만 화면이 너무 작습니다.
windowWidth = screen.width; windowHeight = screen.height;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>PhoneGapTesting</title>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<!-- -->
<script type="text/javascript">
var windowWidth;
var windowHeight;
var canvasMain;
var contextMain;
var backgroundImage;
$(document).ready(function() {
windowWidth = window.innerWidth;
windowHeight = window.innerHeight;
//windowWidth = window.outerWidth; // Only 'window.innerWidth' + 'window.innerHeight' look OK but not max resolution
//windowHeight = window.outerHeight;
//windowWidth = screen.width;
//windowHeight = screen.height;
canvasMain = document.getElementById("canvasSignatureMain");
canvasMain.width = windowWidth;
canvasMain.height = windowHeight;
contextMain = canvasMain.getContext("2d");
backgroundImage = new Image();
backgroundImage.src = 'img/landscape_7.jpg';
backgroundImage.onload = function() {
contextMain.drawImage(backgroundImage, 0, 0, backgroundImage.width, backgroundImage.height, 0, 0, canvasMain.width, canvasMain.height);
};
$("#canvasSignatureMain").fadeIn(0);
})
</script>
</head>
<body scroll="no" style="overflow: hidden">
<center>
<div id="deleteThisDivButNotItsContent">
<canvas id="canvasSignatureMain" style="border:1px solid #000000; position:absolute; top:0;left:0;"></canvas><br>
</div>
</center>
</body>
</html>
감사 : 여기
및 전체 코드입니다. 이 같은
니스. 나는 이것에 관해 완전히 잊었다 :) – K3N