Android 两个带圆角的EditText字段
我的android应用程序中有两个EditText字段。我用XMl文件向一个EditText字段添加了四舍五入的cornors。如下所示 如何使用圆角制作第二版文本?Android 两个带圆角的EditText字段,android,Android,我的android应用程序中有两个EditText字段。我用XMl文件向一个EditText字段添加了四舍五入的cornors。如下所示 如何使用圆角制作第二版文本? 感谢您的帮助。只需创建一个可绘制资源,指定EditText的绘制方式: <?xml version="1.0" encoding="utf-8"?> <!-- res/drawable/rounded_edittext.xml --> <shape xmlns:android="http://sch
感谢您的帮助。只需创建一个可绘制资源,指定EditText的绘制方式:
<?xml version="1.0" encoding="utf-8"?>
<!-- res/drawable/rounded_edittext.xml -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" android:padding="10dp">
<solid android:color="#FFFFFF"/>
<corners
android:bottomRightRadius="15dp"
android:bottomLeftRadius="15dp"
android:topLeftRadius="15dp"
android:topRightRadius="15dp"/>
</shape>
在布局中引用此可绘制文件:
<?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"
>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dip"
android:background="@drawable/rounded_edittext" />
</LinearLayout>
xml代码在哪里。。谢谢你的回复。我会接受你的答案。我需要把图像放在编辑文本栏的中间吗?怎么做?