簡體   English   中英

如何在Java Web應用程序中獲取實際的移動設備屏幕尺寸?

[英]How to get actual mobile device screen size in web applications, javascript?

我編寫基於Cordova的移動應用程序,但屏幕尺寸有問題。

當我獲取屏幕尺寸(適用於Nexus 4)時:

var sw = screen.width;
var  sh =  screen.height;

它給了我:

width: 768; height: 1184 

但是實際大小(當我嘗試調試時)

384 x 567

如何獲得實際的屏幕尺寸?

謝謝,

嘗試

window.innerWidth, window.innerHeight

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM