Trishant Sharma
Trishant Sharma

Reputation: 125

Error:error: expected float but got (raw string) match-parent

There is almost nothing available about this on the net. How to rectify this error even though all my things are correct. Please help in this !!!

Stuck since 2 days and still din't get any answer.

On clicking the selected part in the screenshot it opens the values.xml file which is huge and definitely I am not going to read that.

Here is the link to the screenshot:

Error message screenshot

Upvotes: 2

Views: 3732

Answers (1)

y.allam
y.allam

Reputation: 1516

The problem is in the line

<item name="android:layout_weight">match-parent</item>

the weight property expects a number, something like this:

<item name="android:layout_weight">1</item>

and if you're trying to set the height and mistakenly chose weight, the value must be either match_parent or wrap_content, with UNDERSCORE

Upvotes: 5

Related Questions