Phil
Phil

Reputation: 4069

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>

Upvotes: 7

Views: 15412

Answers (1)

Mr.7
Mr.7

Reputation: 2713

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

Upvotes: 10

Related Questions