<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/bg" android:orientation="vertical" > <EditText android:id="@+id/et" android:layout_width="251dp" android:layout_height="wrap_content" android:layout_gravity="center" android:drawableLeft="@drawable/title" android:background="@drawable/shape" android:padding="10px" android:hint="北京" android:singleLine="true" android:textColor="#FFFAFA"/> </LinearLayout>
shape.xml 代码如下
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#00ff00ff"/> <corners android:radius="8px"/> <stroke android:color="#32CD32" android:width="2px" /> </shape>
转自http://blog.csdn.net/liushengmeng/article/details/8121394
相关推荐
小白分享 Android自定义EditText
Android 自定义控件 EditText输入框两边加减按钮Button
Android自定义EditText,实现带清除功能的输入框
主要为大家详细介绍了Android自定义控件EditText的使用方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
界面上有一个按钮“+”,和按钮“确定”,按“+”后生成3个自定义的EditText,按确定获取所生成的所有EditText的值,亲测可用。!
自定义一个带icon图标带删除按钮的EditText,简洁代码。
自己封装的一个EditText两边放加减按钮Button来控制输入框的数值
自定义Dialog,模拟支付密码输入框,可以自定义显示的图标。EditText遮在背景View的上面,在afterTextChanged处理密码改变的逻辑。
主要为大家详细介绍了Android自定义方框EditText注册验证码,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
Android ContextMenu实例,为EditText文本框添加上下文菜单,菜单激活并显示的方式是,用户在EditText输入框上面长按2秒,即可弹出上下文菜单,如运行截图所示的效果,为实现此功能,创建了onCreateContextMenu ...
android 自定义editText和多级树 editText 自带日历按钮和添加按钮 点击添加按钮选人 选人界面是一个多级树
edittext 自定义按键盘,实现按edittext不弹出系统的按键盘
android 自定义edittext 光标,下划线颜色仅此而已kkkk.
android 自定义EditText,可删除输入框内容,或者修改文本框显示的类型。
栗子——自定义EditText实现右下角计数控件
Android如何自定义EditText下划线?本文教大家利用Android实现自定义的EditText下划线,感兴趣的小伙伴们可以参考一下
NULL 博文链接:https://renxin-327666062-qq-com.iteye.com/blog/1666694
接到一个需求,点击某个按钮需要弹出一个带有EditText的AlertDialog弹窗,实现起来并不难,简单记录下方便以后使用。