Question Detail

Where to define @dimen in android?

5 years ago Views 1811 Visit Post Reply

Here I am little confused, do we get dimen.xml by default in android studio or we have to create that xml under values, manually.


Thread Reply

Hemant Sharma

- 5 years ago

dimen.xml file is auto-imported in your Android Studio Project but at starting it will not show there because Android Studio does not use any unused files.

So if you want to use dimen.xml you have to clear an XML file in your res->Values->dimen.xml

when you use any class where you want any dimen so this class will auto-created. 

Hemant Sharma

- 5 years ago

dimen.xml file is auto-imported in your Android Studio Project but at starting it will not show there because Android Studio does not use any unused files.

So if you want to use dimen.xml you have to clear an XML file in your res->Values->dimen.xml

when you use any class where you want any dimen so this class will auto-created.