简体   繁体   English

如何根据phonegap中的屏幕方向设置“div”大小

[英]how can i set the “div” size according to screen orientation in phonegap

我开发了一个应用程序在手机间隙,看起来很好的肖像,如何在方向改变时增加div大小,可以有人帮助我。

You may want to consider using onRetainNonConfigurationInstance() for the heavy objects in your activity. 您可能需要考虑对活动中的重物使用onRetainNonConfigurationInstance() Take a look at this article for a excellent explanation: http://developer.android.com/resources/articles/faster-screen-orientation-change.html . 请查看本文以获得一个很好的解释: http//developer.android.com/resources/articles/faster-screen-orientation-change.html

Alternatively, you can use static data in an Application class. 或者,您可以在Application类中使用静态数据。 See the Application as a Singleton post here: http://androidcookbook.com/Recipe.seam?recipeId=1218 请在此处查看应用程序作为单身人士帖子: http//androidcookbook.com/Recipe.seam? recipeId = 1218

You need to use responsive design for your pages. 您需要为页面使用响应式设计。 There are a few templates available such as Skeleton and Initializr. 有一些可用的模板,如Skeleton和Initializr。 If you don't want to use the templates you can just add CSS3 media queries yourself to set different div sizes based on screen width. 如果您不想使用模板,您可以自己添加CSS3媒体查询,以根据屏幕宽度设置不同的div大小。

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

相关问题 我如何设置方向屏幕“肖像” - How i can set orientation screen 'PORTRAIT' 如何使用通用图像loader.jar根据屏幕尺寸设置图像尺寸? - How can I set of image size according to screen size with universal image loader.jar? Android上的Phonegap。 针对特定设备尺寸的锁定屏幕方向? - Phonegap on Android. Can a lock screen orientation for a specific device size? 如果我根据特定手机设置字体大小,如何根据android中的屏幕大小更改字体大小? - How to change the font size according to the screen size in android if I set the font sizes according to a specific phone? 如何根据不同的屏幕尺寸设置按钮 - How to set buttons according to different screen size 如何根据视频的高度和宽度设置屏幕方向 - How to set screen orientation according to a video's height and width 如何获取当前的屏幕方向? - How can I get the current screen orientation? 如何使用phonegap中的插件更改屏幕方向? - How use plugin in phonegap for change screen orientation? 如何根据方向更改屏幕布局? - How to change screen layout according to the orientation? 如何水平设置4个RelativeLayout并根据屏幕尺寸自动调整 - How to set 4 RelativeLayout Horizontally and Adjust automatically according to screen size
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM