谁能告诉我如何将编辑文本的上两个角设置为圆角(用户名),将电子邮件的下两个角设置为圆角。
最佳答案
您将需要两个 shape
可绘制文件。
对于顶部的 EditText,调用它,top_edittext_bg
:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid
android:color="#e2e2e2" >
</solid>
<corners
android:radius="1dp"
android:bottomLeftRadius="0.1dp"
android:bottomRightRadius="0.1dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp" >
</corners>
</shape>
对于底部的EditText
,调用它例如bottom_edittext_bg
:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid
android:color="#e2e2e2" >
</solid>
<corners
android:radius="1dp"
android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"
android:topLeftRadius="0.1dp"
android:topRightRadius="0.1dp" >
</corners>
</shape>
然后将 android:background="@drawable/RESPECTIVE_XMLS"
属性中的这些设置为相关的 EditText
。
关于android - 如何创建如图所示的圆形编辑文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14027832/