1

How can i define the match_parent flag in a dimens.xml?

<dimen name="width">match_parent</dimen>

I tried the methods here Value equals to match_parent or fill_parent in dimens.xml? but none work.

Iam using Android > 27 API.

Nick
  • 2,818
  • 5
  • 42
  • 60

1 Answers1

1

First create attribs.xml:

<resources>
    <item name="match_parent" type="dimen">-1</item>
</resources>

Second use your dimens:

  <dimen name="account_width">@dimen/match_parent</dimen>