Android中实现EditText圆角的方法
时间:2023-10-11 20:53:52
一、在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"/>
标签:EditText,圆角
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Android Retrofit原理深入探索
2023-09-06 02:47:15
c# 空合并运算符“??”的使用详解
2022-11-23 13:47:36
ArrayList和LinkedList的区别、扩容机制以及底层的实现方式
2023-11-27 01:26:57
![](https://img.aspxhome.com/file/2023/9/60279_0s.png)
Springboot和bootstrap实现shiro权限控制配置过程
2022-01-19 21:31:23
![](https://img.aspxhome.com/file/2023/2/69952_0s.png)
深入分析JAVA流程控制语句
2023-11-20 10:48:32
Unity常用命令模式详解
2021-12-30 16:58:08
![](https://img.aspxhome.com/file/2023/8/119548_0s.png)
C# 根据表格偶数、奇数加载不同颜色
2022-01-19 11:46:05
![](https://img.aspxhome.com/file/2023/1/111071_0s.png)
Android应用程序的编译流程及使用Ant编译项目的攻略
2022-09-18 18:22:16
![](https://img.aspxhome.com/file/2023/4/126694_0s.jpg)
Android使用Intent显示实现页面跳转
2023-04-16 12:02:21
![](https://img.aspxhome.com/file/2023/4/93284_0s.png)
Java中重载与重写的对比与区别
2021-08-29 13:22:31
用C# 实现鼠标框选效果的实现代码
2023-04-18 14:08:26
C#控件picturebox实现图像拖拽和缩放
2023-08-09 08:23:05
android照相、相册获取图片剪裁报错的解决方法
2021-11-21 20:18:14
opencv检测直线方法之投影法
2023-08-28 04:43:15
![](https://img.aspxhome.com/file/2023/9/124169_0s.jpg)
mybatis教程之resultmap_动力节点Java学院整理
2022-09-05 22:38:37
Android开发中使用sqlite实现新闻收藏和取消收藏的功能
2023-01-27 18:15:13
![](https://img.aspxhome.com/file/2023/1/129011_0s.jpg)
JAVA内部类示例详解及练习
2023-04-05 06:42:39
![](https://img.aspxhome.com/file/2023/7/62427_0s.png)
Java流程控制语句最全汇总(上篇)
2023-11-03 01:57:48
![](https://img.aspxhome.com/file/2023/0/58850_0s.jpg)
Jenkins自动化打包为war包
2021-08-08 20:25:49
![](https://img.aspxhome.com/file/2023/2/103992_0s.jpg)
SpringBoot之Controller的使用详解
2023-02-16 21:18:30
![](https://img.aspxhome.com/file/2023/1/66951_0s.jpg)