android学习笔记(2)EditText控件的学习

android学习笔记(2)EditText控件的学习

分类:android开发学习笔记

对应若水老师的第五课

一,设置一个输入框添加控件:

<EditTextandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:layout_marginTop="52dp" <!–本控件顶部距离上一个控件的距离–>/> 二,消除输入框的聚焦方法一:<EditTextandroid:layout_width="0dp"android:layout_height="0dp"android:layout_marginTop="52dp"/> <EditTextandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:layout_marginTop="52dp"/>方法二:<EditTextandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:layout_marginTop="52dp"><requestFocus />三,限制输入内容与长度android:maxLength="3"android:inputType="number"四,设置提示信息android:hint="输入三个数字"五,在输入框中加入图片在drawable-mdpi放入图片tubiao.jpgandroid:drawableLeft="@drawable/tubiao"

六,将输入框变圆角

在drawable-mdpi中建立文件shape.xml,内容为:<shape xmlns:android=""android:shape="rectangle" ><solidandroid:color="#e2e2e2" ></solid><cornersandroid:radius="7dp"<!–设置弧度–>android:topLeftRadius="5dp"android:topRightRadius="5dp" ></corners></shape>

附Eclipse中的快捷键

Android layout布局属性、标签属性总结大全Android开发之EditText属性详解

版权声明:本文为博主原创文章,未经博主允许不得转载。

上一篇android学习笔记(0)搭建开发环境的前前后后

顶0踩0

,年轻是我们唯一拥有权利去编织梦想的时光

android学习笔记(2)EditText控件的学习

相关文章:

你感兴趣的文章:

标签云: