Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android XML element is not allowed

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>
like image 567
Phil Avatar asked Jun 30 '16 18:06

Phil


People also ask

What is XML element?

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.

Can XML have empty tags?

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."


1 Answers

That XML file should be located in res/drawable. It might be located in res/layout, which is an incorrect location.

like image 127
Mr.7 Avatar answered Sep 19 '22 06:09

Mr.7