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

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -