I have the following XML layout which basically gives me rounded corners and I use it on EditText's. Why does Android inspector say that the element solid is not allowed here
and also element corners is not allowed here.
It works fine, should I just leave it?
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" android:padding="10dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<solid android:color="#FFFFFF" />
<corners
android:bottomRightRadius="5dp"
android:bottomLeftRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp" />
</shape>
The XML elements are the basic building block of the XML document. It is used as a container to store text elements, attributes, media objects etc. Every XML documents contain at least one element whose scopes are delimited by start and end tags or in case of empty elements it is delimited by an empty tag.
In XML, you can indicate an empty element like this: <element></element> or you can use an empty tag, like this (this sort of element syntax is called self-closing): <element /> The two forms above produce identical results in an XML parser."
That XML file should be located in res/drawable
. It might be located in res/layout
, which is an incorrect location.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With