I want set height using values/dimens.xml if i want to set 50dp for values-mdpi/dimens.xml then how to calculate value for values-hdpi/dimens.xml, values-xhdpi/dimens.xml etc.
If i want to achieve below design for all android device how do I create an XML file and values/dimens.xml
for all values folder
50dp
is 50dp
for all screen densities. dp
stands for "density-independent pixels". So, put 50dp
in values/dimens.xml
, and you are done.
I think you are looking for this : SDP
Try this library for perfect design for all devices from small screen to tablet size. You don't need to write dimens file for all screen sizes.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.