在drawble目录下创建一个shape类型的edit_stroke.xml文件
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners android:radius="5dp"/>
<solid android:color="#ffffffff"/>
</shape>
在布局文件中的edittext的background属性中指向这个xml文件即可
android:background="@drawable/edit_stroke"
效果如下
本文将指导您如何在Android应用中使用XML定义一个自定义的形状作为EditText的背景,并通过简单的步骤展示如何创建和应用edit_stroke.xml文件。
643

被折叠的 条评论
为什么被折叠?



