Sandeep P
Sandeep P

Reputation: 4411

how can i set the "div" size according to screen orientation in phonegap

I developed an app in the phone gap which is looking good in portrait, how to increase the div size when orientation changed, can some one help me.

Upvotes: 0

Views: 242

Answers (2)

codemonkey
codemonkey

Reputation: 5267

You need to use responsive design for your pages. There are a few templates available such as Skeleton and 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.

Upvotes: 1

Nimit
Nimit

Reputation: 1712

You may want to consider using onRetainNonConfigurationInstance() for the heavy objects in your activity. Take a look at this article for a excellent explanation: http://developer.android.com/resources/articles/faster-screen-orientation-change.html .

Alternatively, you can use static data in an Application class. See the Application as a Singleton post here: http://androidcookbook.com/Recipe.seam?recipeId=1218

Upvotes: 1

Related Questions