码迷,mamicode.com
首页 >  
搜索关键字:inputmethodmanager    ( 74个结果
和键盘操作相关的工具类KeyBoardUtils
和键盘操作相关的工具类 package com.flyou.utils; import android.content.Context; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; /** * 打开或关闭软键盘 * * @author flyou * */...
分类:其他好文   时间:2015-03-29 16:32:24    阅读次数:108
android 显示和隐藏输入法键盘用法介绍
在个别时候,需要强制隐藏Android输入法键盘,如当前键盘正在显示,这个时候点击了侧滑面板,就要强制隐藏输入法键盘。网上常见的方法有: 1、InputMethodManager imm = (InputMethodManager) getActivity() .getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftI...
分类:移动开发   时间:2015-03-21 17:14:01    阅读次数:172
Keyboard的显示与隐藏
一个控制键盘显示与隐藏的工具类分享给大家 public class KeyBoardTool { /** * 如果输入法在窗口上已经显示,则隐藏,反之则显示 * @param context */ public static void showOrhide(Context context){ InputMethodManager imm = (InputMethodManager) ...
分类:其他好文   时间:2015-03-20 22:09:29    阅读次数:156
安卓 收起软件盘
public static void collapseSoftInputMethod(Context context, View v) { if (v != null) { InputMethodManager imm = (InputMethodManage...
分类:移动开发   时间:2015-03-20 12:22:23    阅读次数:147
安卓工具类-------->打开或关闭软键盘
import android.content.Context; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; //打开或关闭软键盘 public class KeyBoardUtils { /** * 打卡软键盘 * * @param mEditText输入框...
分类:移动开发   时间:2015-02-06 18:55:33    阅读次数:169
键盘的隐藏和显示
// 如果键盘是显示的,那么隐藏,反之亦然 InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(0, Inpu...
分类:其他好文   时间:2015-01-28 19:28:40    阅读次数:192
Android控制软键盘的现实与隐藏
在activity2中弹出来软键盘,点击返回后,进入activity1,里面也有edittext,这样的话软键盘还是会显示在那里,有时挺影响体验的。可以在返回事件中添加这样一个方法:private void closeSoftInput() { InputMethodManager imm ...
分类:移动开发   时间:2015-01-23 16:07:03    阅读次数:138
Android PopupWindow中EditText获取焦点自动弹出软键盘
公司的项目中要求在点击搜索的时候弹出一个搜索框,搜索框中有一个EditText,用于数据搜索关键字,要求在弹出PopupWindow的时候自动弹出软键盘,原以为只要写上着两行代码可以搞的问题:1 InputMethodManager inputMethodManager=(InputMethodMa...
分类:移动开发   时间:2015-01-08 19:28:18    阅读次数:699
【Android】键盘的展开和收起
键盘的展开和收起主要使用到类InputMethodManager:http://developer.android.com/reference/android/view/inputmethod/InputMethodManager.html其大致方法如下:1 public void hide_key...
分类:移动开发   时间:2015-01-02 19:53:30    阅读次数:191
Android自动打开和关闭软键盘
现在有一个需求是说希望可以自动的隐藏和打开软键盘,场景是使用在alert dialog中有一个文本框,弹出dialog同时自动弹出键盘,编辑后点击完成直接关闭。使用的方式是: inputManager.showSoftInput(tvEditor,  InputMethodManager.SHOW_FORCED); 如果使用参数InputMethodManager.SHOW_IMPLICI...
分类:移动开发   时间:2014-12-23 15:33:16    阅读次数:260
74条   上一页 1 ... 3 4 5 6 7 8 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!