1.如何对EditText进行setText()的时候使其自动换行
<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);

更多相关文章

  1. 自定义SeekBar
  2. Android(安卓)layout属性大全
  3. [Android] 零碎知识汇总 - Shape相关
  4. Android(安卓)UI布局中设置了fill_parenet仍然没有全屏的解决办
  5. Android中gravity与layout_gravity的区别, Padding 与 margin 区
  6. Android(安卓)animation Interpolator属性 设置动画速度介绍?
  7. GridView控件的简单使用
  8. Android(安卓)GridView属性
  9. Android(安卓)图表开源框架之MPAndroidChart LineChart折线图(六)

随机推荐

  1. Android(十):屏幕相关操作
  2. android ViewSwitcher详解
  3. Android计算地图上两点距离
  4. sqlit导入外部数据库查找数据方法
  5. cocos2d-x学习笔记 如何将win32移植到and
  6. Android彩蛋效果,微信彩蛋效果
  7. Android ApiDemos示例解析(139):Views->L
  8. Android NDK编译lame
  9. 获取Android自带资源的方式
  10. Android下如何获取Mac地址?