【发布时间】:2011-07-29 03:07:05
【问题描述】:
谁能告诉我如何在android中创建一个带圆角的可编辑文本框?
我尝试使用此代码,但它不起作用:
<?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="0dp"
android:bottomLeftRadius="0dp" android:topLeftRadius="15dp"
android:topRightRadius="15dp" />
</shape>
谢谢
【问题讨论】:
-
在 OS 2.3 之前,android 编辑文本的背景是圆角的。所以你可以做的是,将旧的背景图片复制到你的 res 文件夹中,然后在你的 xml 文件中手动设置它。
标签: android