我想让linearlayout的四角用this四舍五入来回答。因此,这里是我的shape.xml:在android中没有边框的形状
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke android:width="2dp" android:color="#FFFFFFFF" />
<gradient android:startColor="#ffc578" android:endColor="#fb9d23"
android:angle="225"/>
<corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp"
android:topLeftRadius="7dp" android:topRightRadius="7dp"/>
</shape>
但是这给了我黑色的丑陋一个border.It矩形形状看起来与一个美丽的背景图像的其他的LinearLayout里面太可怕了。我想摆脱那个黑色边框。我已经通过其他SO帖子和谷歌搜索,只是发现我可以使用图层来隐藏一些边界。是不是可以直接在上面的shape.xml中使用一些技巧?
编辑:
这里是我的布局main.xml中:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/MovieHopBackground"
android:weightSum="12"
>
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="3"
android:id="@+id/imageView"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="0"
android:layout_weight="2"
android:weightSum="4"
android:background="@drawable/shape">
<RelativeLayout
android:orientation="horizontal"
android:layout_width="0"
android:layout_height="fill_parent"
android:layout_weight="3"
>
<EditText
android:layout_width="150dp"
android:layout_height="50dp"
android:background="@drawable/rounded_edittext"
android:id="@+id/editText"
android:layout_centerInParent="true"
/>
</RelativeLayout>
<RelativeLayout
android:orientation="horizontal"
android:layout_width="0"
android:layout_height="fill_parent"
android:layout_weight="1"
>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
EDIT2: 下面是截图在IDE(裁剪):
你想要一个带有圆角的图像背景吗? –
@RajeshCP同样的结果。 – rahulserver