Re: DP Vs PX

811 views
Skip to first unread message

rlay3

unread,
Oct 29, 2012, 9:07:04 PM10/29/12
to phon...@googlegroups.com
Hi Michael, you can certainly switch stylesheets based on screen density in phonegap!

Here's something to get your started. Searching for css media queries will also give you a wealth of information.

On Tuesday, 30 October 2012 05:27:46 UTC+11, Michael Crinnion wrote:
Hi,

I am just getting started with PhoneGap and App development in this way. I have what I think is probably a very newbie question...

I am trying to create an app that follows Google's guidelines strictly for a native app / pure android feel. All of their size guidelines are in dp, their density independent pixel unit which of course isn't supported in CSS. I know I can convert this to pixels based on the screen density of any given device but how do I accommodate for multiple screen densities? Is there a way to switch style sheets based on screen density? Does PhoneGap have a clever way of handling this that I haven't discovered?

A specific example would be the action bar that is at the top of most native android apps. This is 32dp which calculates as 24px@ldpi, 32px@mdpi, 48px@hdpi and 64px@xhdpi.

Any help would be greatly appreciated.

Michael

Juan Carlos Alpízar

unread,
Feb 13, 2014, 1:12:51 PM2/13/14
to phon...@googlegroups.com
Wow this solved most of the problems I was facing, thanks for the awesome info rlay3!!
Reply all
Reply to author
Forward
0 new messages