android - edittext 默认隐藏软键盘
16lz
2021-01-23
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>
属于别人使用的方法,几天后整理,搜不到原引用了,抱歉。
更多相关文章
- Android 4.0.3 源码编译中添加外部jar包和外部so到apk的方法
- Android自定义控件布局刷新自定义控件回到初始位置问题的解决
- Android基于基于布局嵌套的页面导航实现
- Android中两种设置全屏的方法
- RelativeLayout相对布局中的属性
- android 使用html5作布局文件: webview跟javascript交互
- android实现字体闪烁动画的方法
- 在Fragment中设置控件点击方法,执行失败。