如何更改相对布局边框颜色?这是我下面的代码,我只想显示边框颜色黑色,但显示所有相对布局黑色。我只想显示相对布局白色,只有边框是黑色我该怎么办?
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/border5">
<?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="#000000" />
</shape>
</item>
<item android:left="1dp" android:top="1dp" android:bottom="2dp" >
<shape android:shape="rectangle">
</shape>
</item>
</layer-list>
这就是我给我的白色的方式background
和橙色边框
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="@drawable/white" />
<stroke
android:width="3px"
android:color="@drawable/orange" />
</shape>
如果你只是想要一个边框,那么你可以将它们全部保留在同一个中<shape>
并使用<solid...>
为了background
颜色(如果你想给它一个)和<stroke...>
为边界。
你可以按照你的方式去做,只需改变<solid>
to the background
你想要的颜色并添加<stroke>
与黑色
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)