m - How can i support different measurements for screens in android -
i want accomplish adequate size of layouts depending on screen size of device. using dp unit, doesn't seem work. how can that?
for sure dp adequat unit accomplish goal. there in addition that, have define several values folders define dimensions scaling tablets or phones. e.g. define 2 values folders like:
values-large values-xlarge
now define dimen.xml file inside folders, can put measurements in (unit dp) corresponding screensize. define measurement this:
17dp
then embedd sizes in layout xml, like:
android:layout_height="@dimen/value1"
depending on screensize, system load correct measurements folders, e.g. if have screen size large defined values in folder values-large loaded. more information, have @ https://developer.android.com/distribute/essentials/quality/tablets.html
Comments
Post a Comment