Howdy. In my theme.xml definition, I have the following:
<style name="mythemename">
<item name="d_myvar">100dip</item>
</style>
I would like to be able to reference this in res / values /dimens.xml as follows:
<dimen name="myvar">?d_myvar</dimen>
Alas, this does not work. When I try to use @ dimen / myvar as the height of LinearLayout, the application crashes with the error "You must specify the layout height attribute".
I also tried
<dimen name="myvar" value="?d_myvar" />
But this does not compile.
How can I define @ dimen / myvar in my xml so that it loads a variable ? d_myvar defined in the topic?
Thank!
source
share