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. Android实现输入法弹出时把布局顶上去和登录按钮顶上去的解决方
  2. Android EditText 不自动获取焦点(不自动弹出输入法)
  3. android 输入法出现挤压屏幕、android输入键盘覆盖了屏幕控件的
  4. 【android】两个按钮的宽度各占屏幕的一半
  5. Android新增AppCompatTextView自适应字体大小和文本宽度
  6. 骗局!卸载搜狗输入法教程
  7. 如何在流体宽度旋转木马中的页面之间创建装订线?
  8. jQuery的宽度、内宽和外宽、高度、内高和外高有什么区别
  9. 模态的jQuery动态高度宽度

随机推荐

  1. android textview 自动链接网址 修改默认
  2. Android 屏幕旋转时保存状态
  3. BlueStacks再获640万美元投资,让Android应
  4. Android中PopupWindow自定义坐标实现
  5. Android开发之与服务器(jsp)发送、接受JSON
  6. Android(安卓)AdapterView 源码分析以及
  7. 关于handler
  8. Android——4.2.2 文件系统文件夹分析
  9. Android设置字体
  10. android电话服务