Assigning ‘wrap_content’ or ‘-2’ to dimension

To use wrap_content or match_parent you need to create following items in dimens.xml file:

<item name="match_parent" format="integer" type="dimen">-1</item>
<item name="wrap_content" format="integer" type="dimen">-2</item>

Then you can simply use it like this:

<dimen name="layout_height">@dimen/match_parent</dimen>
<dimen name="layout_width">@dimen/wrap_content</dimen>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)