简体   繁体   English

如何根据设备/屏幕分辨率调整屏幕尺寸?

[英]How to fit screen as per device/screen resolution?

I have done application using Extjs4.1 working very nicely. 我已经使用Extjs4.1很好地完成了应用程序。 client they need screen like once they visit application url in different device except phone. 客户需要像访问电话​​以外的其他设备中的应用程序URL一样需要屏幕。 All screens should be fit as per device without any horizontal/vertical scroll bar. 所有屏幕均应按设备安装,没有任何水平/垂直滚动条。 I have included a line of code in the index.html file within head, meta tag as below. 我在head,meta标签内的index.html文件中包含了以下代码行。 so now application is fitting in ipad without any scroll bar. 所以现在应用程序适合没有任何滚动条的ipad。 In my desktop monitor also screen is fitting nicely, but same application url if i browse in laptop horizontal/vertical scroll bar coming. 在我的台式机显示器上,屏幕也很合适,但是如果我在笔记本电脑的水平/垂直滚动条中浏览,则使用相同的应用程序URL。 How to fit all screens in laptop device like ipad/desktop monitor?. 如何在笔记本设备(如ipad /台式机显示器)中安装所有屏幕? I am not using flex, because if it small device it will fit, but problem all component will be merge one above the other(overlap) while minimizing/maximizing also has the problem. 我没有使用flex,因为如果它适合小型设备,但是问题是所有组件都将在另一个组件上重叠(重叠),同时最小化/最大化也有问题。 Can any body tell me how to resolve this issue? 谁能告诉我如何解决这个问题? Great appropriated. 伟大的。 Thank you 谢谢

Code is Here: 代码在这里:

<head>      
    <meta name="viewport" content="width=1024">    
</head>

In extjs not able to differentiate laptop and desktop device. 在extjs中,无法区分笔记本电脑和台式机设备。 I have gone different way. 我走了不同的路。 but this not correct way. 但这不是正确的方法。 we can achive as per requirement. 我们可以根据要求实现。 In view globally calculating height of the screen. 在视图中全局计算屏幕高度。 if screen resolution is 1600X900 (Desktop) window.ineerHeight will be come more than 700. if screen resolution is less than 1600x900 window.innerHeight will be less than 700. So here calculating dynamic value assigning to component. 如果屏幕分辨率为1600X900(桌面)window.ineerHeight将大于700。如果屏幕分辨率小于1600x900 window.innerHeight将小于700。因此,此处计算分配给组件的动态值。 it is working very nicely for me. 它对我来说很好。 Cheers 干杯

Here is my code: 这是我的代码:

if(window.innerHeight>700){ 
    var paddingValue = 10; 
    var imgHeight = window.innerHeight/4.1; //Desktop
}
else{
   var paddingValue = window.innerHeight/35;
   var imgHeight = window.innerHeight/5.7;  //Laptop 
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM