答案 0 :(得分:1)
我认为现在它的显示就像你的期望,谢谢
答案 1 :(得分:0)
这有招:)
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<gradient
android:angle="45"
android:endColor="#0256FC"
android:centerColor="#0256FC"
android:startColor="#FE00B1" />
<corners android:radius="4dp" />
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:top="1dp" />
<size
android:width="162dp"
android:height="44dp" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/colorWhite" />
<corners android:radius="4dp" />
<size
android:width="50dp"
android:height="50dp" />
</shape>
</item>
</layer-list>
答案 2 :(得分:-1)
创建 button_border.xml 并将其保留在drawable中。
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- view border color and width -->
<stroke
android:width="1dp"
android:color="@color/white" >
</stroke>
<!-- The radius makes the corners rounded -->
<corners
android:radius="2dp" >
</corners>
</shape>
现在按如下方式设置您的editText背景:
android:background="@drawable/button_border"