问题是:LinearLayout必须有一个不同的背景(白色颜色)和一个深色的轮廓。
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape = "rectangle">
<corners
android:radius="2dp"
android:topRightRadius="0dp"
android:bottomRightRadius="0dp"
android:bottomLeftRadius="0dp" />
<stroke
android:width="1dp"
android:color="#000000" />
</shape>我尝试过的是:下面的代码在布局文件中被称为"android:background"元素。这样做并不允许我的LinearLayout有我想要的白色背景,但是获得了黑暗的轮廓。对我如何做到这两点有什么想法吗?(帮助:)
发布于 2013-08-22 07:28:22
你也可以试试这个
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape = "rectangle">
<corners
android:radius="2dp"
android:topRightRadius="0dp"
android:bottomRightRadius="0dp"
android:bottomLeftRadius="0dp" />
<stroke
android:width="1dp"
android:color="#000000" />
<gradient android:startColor="#FFFFFF"
android:endColor="#FFFFFF"
android:angle="90"/>
</shape>发布于 2013-08-22 07:17:01
将您的LinearLayout放在FrameLayout中。给FrameLayout黑色背景。给LinearLayout的白色背景。将LinearLayout's边距设置为1dp
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/black" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="1dp"
android:background="@android:color/white" >
....
....
</LinearLayout>
</FrameLayout>https://stackoverflow.com/questions/18373734
复制相似问题