How do I layout an android app in Photoshop using PX if google only provides me DP?

Asked

Viewed 852 times

4

I’m trying to draw the layout in photoshop, but I can’t understand this history of DP in photoshop, in code it’s okay, the compiler understands, but in photoshop I can only work in PX.

Can anyone help me with this? Like, the height of the status bar or the action bar, the distance of the elements and etc.

  • 1

    See if this helps you http://labs.rampinteractive.co.uk/android_dp_px_calculator/ ’s distance from the elements you can use their margin/padding property depending on what you want to do.

  • Help yes @Paulo thanks

1 answer

2

You need to do pixel to dp conversion depending on the density of the screen you intend to develop, pixel dp ratio is given by:

pixel / density

For example, if you want to develop for hdpi density the density value is 2.0x, if you have an image 500p wide the equivalent in dp is given by:

500 / 2.0 = 250dp

Of course depending on the layout this value can be adapted, if the result gives a fractional value and etc.

I recommend reading this page. This should help you better understand the densities of Android.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.