我试图在几种布局中使用圆形形状,但由于某些原因,即使角落是圆形的,在背景中也有不圆角的角落。 有人知道为什么吗?Android圆形转角不圆
代码:
dialog_background:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/jobim_white" ></solid>
<stroke
android:width="1dp"
android:color="@color/colorPrimary" ></stroke>
<corners android:radius="8dp"></corners>
</shape>
search_edittext_shape:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" android:padding="10dp" >
<solid android:color="#FFFFFF" />
<corners
android:bottomLeftRadius="8dp"
android:bottomRightRadius="8dp"
android:topLeftRadius="8dp"
android:topRightRadius="8dp" />
</shape>
的RelativeLayout(的对话框):
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/dialog_background" >
的LinearLayout(所述的EditText的):
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:background="#ECECEC">
<EditText
android:id="@+id/searchTypeEdtTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableRight="@drawable/ic_search"
android:drawableTint="#D0D0D0"
android:background="@drawable/search_edittext_shape"
android:hint="@string/search"
android:textColorHint="#ECECEC"
android:elevation="3dp"
android:textCursorDrawable="@drawable/cursor_color" />
</LinearLayout>
是这样的:
谢谢
我的坏...它刚刚在格式化中丢失了 – henengel
dialog.getWindow()。setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); –
尝试angrytools.com –