0

我想在顶部和底部显示不同颜色的边框,顶部是#e6e6e6,底部是#f7f7f7,我制作了顶部边框,但是当我尝试在底部显示边框时,它只显示边框底部,而顶部边框缺失。这是我的 xml:

    <?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
       <item> 
    <shape android:shape="rectangle">
      <solid android:color="#CECECE" /> 
      <corners
          android:topLeftRadius="5dp"
          android:topRightRadius="5dp"
          android:bottomLeftRadius="5dp"
          android:bottomRightRadius="5dp"
          />
    </shape>
  </item>  
         <item > 
    <shape android:shape="rectangle">
      <solid android:color="#C7C7C7" /> 
      <corners
          android:topLeftRadius="5dp"
          android:topRightRadius="5dp"
          android:bottomLeftRadius="5dp"
          android:bottomRightRadius="5dp"
          />
    </shape>
  </item> 

   <item android:top="1dp" android:bottom="1dp">  
    <shape android:shape="rectangle">
      <solid android:color="#e6e6e6" /> 
      <corners
          android:topLeftRadius="5dp"
          android:topRightRadius="5dp"
          android:bottomLeftRadius="5dp"
          android:bottomRightRadius="5dp"
          />
    </shape>
  </item>   


</layer-list>

有没有人可以帮我解决我的问题?非常感谢您。

4

0 回答 0