android 圆角编辑框
来源:互联网 发布:网站80端口如何申请 编辑:程序博客网 时间:2024/04/29 14:21
main.xml:
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- >
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center_horizontal"
- android:text="圆角编辑框"
- />
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center_horizontal"
- android:orientation="horizontal">
- <EditText
- android:layout_width="220px"
- android:layout_height="wrap_content"
- android:padding="5px"
- android:background="@drawable/rounded_edittext_states"
- android:drawableLeft="@drawable/search"
- android:singleLine="true"
- android:lines="1"
- />
- <Button
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:background="@drawable/button_search_bg"
- />
- </LinearLayout>
- </LinearLayout>
rounded_edittext_states.xml :
- <?xml version="1.0" encoding="utf-8"?>
- <!-- res/drawable-hdpi/rounded_edittext_states.xml -->
- <selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item
- android:state_pressed="true"
- android:state_enabled="true"
- android:drawable="@drawable/rounded_focused" />
- <item
- android:state_focused="true"
- android:state_enabled="true"
- android:drawable="@drawable/rounded_focused" />
- <item
- android:state_enabled="true"
- android:drawable="@drawable/rounded_edittext" />
- </selector>
rounded_edittext.xml :
- <?xml version="1.0" encoding="utf-8"?>
- <!-- res/drawable/rounded_edittext.xml -->
- <shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="rectangle"
- android:padding="8dip">
- <solid android:color="#FFFFFF"/>
- <corners
- android:bottomRightRadius="10dip"
- android:bottomLeftRadius="10dip"
- android:topLeftRadius="10dip"
- android:topRightRadius="10dip"/>
- </shape>
rounded_edittext_focused.xml :
- <?xml version="1.0" encoding="utf-8"?>
- <!-- res/drawable/rounded_edittext_focused.xml -->
- <shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="rectangle"
- android:padding="8dip">
- <solid android:color="#FFFFFF"/>
- <stroke android:width="2dip" android:color="#999" />
- <corners
- android:bottomRightRadius="10dip"
- android:bottomLeftRadius="10dip"
- android:topLeftRadius="10dip"
- android:topRightRadius="10dip"/>
- </shape>
工程源码: http://download.csdn.net/source/3409407
- android 圆角编辑框
- android 圆角编辑框
- android 圆角编辑框
- Android 编辑框增加圆角边框
- 【Android】 图片编辑:创建圆角图片
- Android 编辑框问题
- android自定义编辑框
- android编辑框
- Android 悬浮编辑框
- Android之如何用代码使编辑框等组件显示为圆角
- Android 带编辑框的弹出框
- android 限制编辑框输入中文
- Android编辑框单击设定时间
- android之编辑框限定范围
- android 可编辑下拉框的实现
- Android 编辑框(EditText)属性
- Android之编辑框(EditText)控件
- Android-View-Animation 编辑框抖动shake
- Oracle10G 纵向字段横向显示示例
- CentOS 6.2 发布
- web.xml 中的listener、 filter、servlet 加载顺序及其详解
- 庆祝一下,Android视频采集+H264编码成功
- BCB中如何将yyyymmdd的AnsiString转换成yyyy-mm-dd的Date格式
- android 圆角编辑框
- 砌墙的差距
- MySQL中修改密码及访问限制设置详解
- Splunk Remote Root Exploit
- MYSQL常用命令
- HorizontalScrollView实现Gallery
- android 弹出窗口
- android 实现图片的边框
- 最近在S5pv210的平台的一些wince驱动完善进展情况(作者:gooogleman)