Issue
For instance, I have a Galaxy Tab 2 http://www.gsmarena.com/samsung_galaxy_tab_2_10_1_p5100-4567.php which has display size 800 x 1280 pixels
How can I calculate with and height in dp? I want to use relevant values in resource folder names
values-sw600dp
Solution
Galaxy Tab 2 has 10.1" display and 800 x 1280.
For sw (smallest width):
800 / (141/160) = 800 / 0.88125 = 907.8 dp -> so it fits to for example into sw600dp.
141 - DPI of screen
160 - DPI of MDPI screen
800 - pixels in width
Basicaly sw-600dp fits to 7" tablets and sw-720dp fits to 10" tablets.
Answered By - traninho
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.