Android中实现EditText圆角的方法
更新时间:2013年03月14日 09:49:59 作者:
Android中实现EditText圆角的方法,需要的朋友可以参考一下
一、在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 ListView实现上拉加载更多和下拉刷新功能
这篇文章主要为大家详细介绍了Android ListView实现上拉加载更多和下拉刷新功能,介绍了ListView刷新原理及实现方法,感兴趣的小伙伴们可以参考一下2016-05-05Android开发中ImageLoder加载网络图片时将图片设置为ImageView背景的方法
这篇文章主要介绍了Android开发中ImageLoder加载网络图片时将图片设置为ImageView背景的方法,涉及Android ImageView图片加载及背景设置相关操作技巧,需要的朋友可以参考下2018-01-01Android InputMethodManager输入法简介
这篇文章主要介绍了Android InputMethodManager输入法框架的使用,具有参考价值,需要的朋友可以参考下。2016-06-06Android studio保存logcat日志到本地的操作
这篇文章主要介绍了Android studio保存logcat日志到本地的操作,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧2020-04-04
最新评论