EditText的一些使用注意点
来源:互联网 发布:淘宝海外叫什么 编辑:程序博客网 时间:2024/05/22 12:44
1.如何对EditText进行setText()的时候使其自动换行
我们只要确保singleLine为false的话,并且设置宽度一定,就可以自动换行,注意在这里不要设置
不然就不会自动换行
2.在TableLayout中布局一行,设置EditText的xml属性:
3.如何设置EditText隐藏键盘
4.如何设置EditText不被输入法遮盖
- <EditText android:layout_width="200dp" android:layout_height="wrap_content"
- android:id="@+id/input" android:singleLine="false"
- />
我们只要确保singleLine为false的话,并且设置宽度一定,就可以自动换行,注意在这里不要设置
- input.setInputType(0);
不然就不会自动换行
2.在TableLayout中布局一行,设置EditText的xml属性:
- <!-- android:shrinkColumns="1" shrinks the 2nd column to fit the window -->
- <!-- android:stretchColumns="1" stretches the 2nd column -->
- <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent" android:layout_height="fill_parent"
- android:orientation="vertical" android:paddingLeft="5dp"
- android:paddingRight="5dp" android:stretchColumns="1">
- <TableRow android:layout_width="fill_parent"
- android:layout_height="wrap_content" android:orientation="horizontal">
- <TextView android:layout_width="wrap_content"
- android:layout_height="wrap_content" android:text="Email"
- android:paddingRight="5dp">
- </TextView>
- <EditText android:id="@+id/txtEmail" android:layout_width="200dp"
- android:layout_height="wrap_content" android:textSize="18sp"
- android:singleLine="false" android:inputType="textEmailAddress">
- </EditText>
- </TableRow>
- </TableLayout>
3.如何设置EditText隐藏键盘
- (EditText)mMarket.setInputType(0);
4.如何设置EditText不被输入法遮盖
- getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
- EditText的一些使用注意点
- EditText的一些使用注意点
- EditText使用注意点
- 使用CTime的一些注意点
- TextView使用的一些注意点
- 使用memcache的一些注意点(一)
- 使用block的一些注意点
- CollapsingToolbarLayout使用的一些注意点
- 使用webpack时的一些注意点
- RecycleView的使用以及一些注意点
- 自定义EditText的构造器注意点
- C++的一些注意点
- 一些细碎的注意点
- Hibernate 的一些注意点
- Hibernate 的一些注意点
- c 的一些注意点
- 继承的一些注意点
- #define的一些注意点
- php中ereg()函数和eregi()函数-字符串对比解析函数
- Hibernate 查询1+N问题详解
- 如何使用glew
- VC++6.0使用CSplitterWnd类分割窗体,拆分窗体
- 每日一句1
- EditText的一些使用注意点
- Android 2.2 API demo
- struts1多文件上传
- NEC项目积累--String.IsNullOrEmpty
- linux下线程池创建
- 思科交换机MST配置命令步骤-实例讲解
- uboot 启动流程 freescale
- 面试-海量知识-笔记
- .net调用存储过程(包含多个输入输出参数)的处理方式