不允许使用Android XML元素

时间:2016-06-30 18:59:22

标签: android android-layout

我有以下XML布局,基本上给我圆角,我在EditText上使用它。为什么Android检查员会说element solid is not allowed here以及element corners is not allowed here.

它工作正常,我应该离开吗?

<?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>

1 个答案:

答案 0 :(得分:8)

该XML文件应位于res/drawable中。它可能位于res/layout,这是一个不正确的位置。