手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >Android中实现EditText圆角的方法
Android中实现EditText圆角的方法
摘要:一、在drawable下面添加xml文件rounded_editview.xml复制代码代码如下:二、在EditText的backgroun...

一、在drawable下面添加xml文件rounded_editview.xml

复制代码 代码如下:

<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android"

android:shape="rectangle">

<solid android:color="#FFFFFF"></solid>

<padding android:left="10dp"

android:top="10dp"

android:right="10dp"

android:bottom="10dp"></padding>

<corners android:radius="15dp"></corners>

</shape>

二、在EditText的background属性中引用这个xml

复制代码 代码如下:

<EditText

android:id="@+id/et_username"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:inputType="text"

android:background="@drawable/rounded_editview"

android:hint="@string/text_hint_username"/>

【Android中实现EditText圆角的方法】相关文章:

android帮助文档打开慢的三种解决方法

Android中3种图片压缩处理方法

Android实现多线程断点下载的方法

Android上使用jspf插件框架的方法

Android实现语音识别代码

Android开发之动画实现方法

android判断软件是否第一次运行的方法

Android获取SD卡上图片和视频的缩略图

Android中的文件I/O操作

Android中获取IMEI码的办法

精品推荐
分类导航