Android 如何更改相对布局边框颜色?
如何更改相对布局边框颜色??这是我下面的代码,我只想显示边框颜色黑色,但显示所有相关布局黑色。我只想显示相对布局白色只有borde会是黑色我会怎么做Android 如何更改相对布局边框颜色?,android,Android,如何更改相对布局边框颜色??这是我下面的代码,我只想显示边框颜色黑色,但显示所有相关布局黑色。我只想显示相对布局白色只有borde会是黑色我会怎么做 <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/border5"> 我就是这样给我的背景加上白
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/border5">
我就是这样给我的背景加上白色的
背景和橙色边框的
<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>
如果您只是想要一个边框,那么您可以将所有边框保持在相同的
中,并使用
作为背景颜色(如果您想给它一种颜色),使用
作为边框
你可以按照你的方式来做,只需将
更改为你想要的背景颜色,并将
添加为黑色Hy,最好使用dp而不是px
<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>