ANDROID: ImageView for different sizes -
i new android studio; please excuse if query trivial. problem understanding layouts.
my layout , corresponding values folder shown below. problem correct layout not being picked up. example, nexus 4 (4.7inch, 768x1280, xhdpi), in landscape mode, layout being picked 'layout' folder. per understanding (which might totally wrong :) ) should have been picked layout-sw720dp-xhdpi. suggestions please?
sw stands smallest width. if device has width of 320dp in portrait mode , 720dp in landscape mode end device's smallest width 320dp.
try use layout-w720dp-xhdpi instead of layout-sw720dp-xhdpi , see if works.
how calculate device dimensions in dp
edit:
according wikipedia "the nexus 7 (2013) screen has 1920×1200 pixel resolution (960dp × 600dp)". smallest width 600dp why layout isn't being used.
proof
ppi = (√(19202 + 12002))/7.02 = 322.53
width in dp = (1920*160)/322.53 = 952.47 = roughly 960dp
height in dp = (1920*160)/322.53 = 595.29 = roughly 600dp
Comments
Post a Comment