edittext 默认隐藏软键盘

方法一:

在 edittext 最外层的布局加入下面两句:

android:focusable="true"
android:focusableInTouchMode="true"

代码如下:

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="horizontal" >

<EditText
android:id="@id/edit_news_gathering_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:hint="@string/newsGatheringTitle"
android:inputType="text" />
</LinearLayout>

属于别人使用的方法,几天后整理,搜不到原引用了,抱歉。

更多相关文章

  1. Android 4.0.3 源码编译中添加外部jar包和外部so到apk的方法
  2. Android自定义控件布局刷新自定义控件回到初始位置问题的解决
  3. Android基于基于布局嵌套的页面导航实现
  4. Android中两种设置全屏的方法
  5. RelativeLayout相对布局中的属性
  6. android 使用html5作布局文件: webview跟javascript交互
  7. android实现字体闪烁动画的方法
  8. 在Fragment中设置控件点击方法,执行失败。

随机推荐

  1. Android如何实现模态对话框(Modal Dialog)
  2. Android垃圾回收解析
  3. Android键盘自动弹出解决方法分析
  4. 安卓开发,版本号管理总结android:versionC
  5. [Android]ListView美化:去阴影、底色、选
  6. android hierarchyViewer 的UI工具的使用
  7. 系出名门Android(9) - 数据库支持(SQLite
  8. android parcelable 详细介绍
  9. Android 高德地图 Native method not fou
  10. Android Material Design: NavigationVie