当前位置: 移动技术网 > IT编程>移动开发>Android > Android中实现EditText圆角的方法

Android中实现EditText圆角的方法

2019年07月24日  | 移动技术网IT编程  | 我要评论

限售股减持规定,wwww5c5c5c,陈沛嘉

一、在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"/>

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网