我正在使用以下代码编写XML文件:
<layer-list>
<item android:right="5sp" android:top="5dp">
<shape>
<corners android:radius="2dp"/>
<solid android:color="#D6D6D6"/>
</shape>
</item>
<item android:button="2dp" android:left="2dp">
<shape>
<gradient android:angle="270" android:endColor="#4A6EA9" android:startColor="#4A6EA9" />
<stroke android:width ="1dp" android:color="#BABABA" />
<corners android:radius="2dp" />
<padding android:button="10dp" android:left="10dp" android:right="10sp" android:top="10sp" />
</shape>
</item>
</layer-list>
我无法弄清楚为什么我会一直收到错误:
错误:不允许维度类型(在&#39;按钮&#39;值为10dp)
错误:不允许维度类型(在&#39;按钮&#39;值为2dp)
我也收到警告信息:
错误代码:IDE0006:&#34;加载项目时遇到错误。某些项目功能(例如失败项目的解决方案分析和依赖它的项目)已被禁用。&#34;
&#34;无法找到元素&#39;角落的架构信息。&#34;
&#34;无法找到该元素的架构信息&#39; Gradient&#39;。&#34;
&#34;无法找到元素&#39;项目的架构信息。&#34;
&#34;无法找到元素&#39;架构的架构信息&#39;。&#34;
&#34;找不到元素&#39;填充&#39;的格式信息。&#34;
&#34;无法找到元素&#39;选择器的架构信息。&#39;
&#34;无法找到元素&#39;形状的架构信息。&#34;
&#34;无法找到元素&#39;尺寸的架构信息。&#34;
&#34;找不到该元素的架构信息&#39; solid&#39;。&#34;
答案 0 :(得分:0)
我想通了......在我的代码中我输入的是android:button ...应该是android:bottom ...
不知道我是怎么想的那样...修复了错误信息。我仍然收到IDE警告。不知道我怎么能解决这个问题。如果我打开一个新项目,我就不会在新项目中得到错误。