Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Using dimen.xml from code

I am using dimen.xml for supporting multiple screen sizes.

How can I access the file and get the dimen from code so can be used in the application?

Yoav

like image 794
user1136875 Avatar asked Dec 08 '22 23:12

user1136875


1 Answers

You can use the following:

float yourDimen = getResources().getDimension(R.dimen.your_dimen_name);
like image 102
Cat Avatar answered Dec 31 '22 16:12

Cat