和键盘操作相关的工具类KeyBoardUtils

package com.flyou.utils;import android.content.Context;import android.view.inputmethod.InputMethodManager;import android.widget.EditText;/** * 打开或关闭软键盘 * * @author flyou * */public class KeyBoardUtils{/** * 打卡软键盘 * * @param mEditText *输入框 * @param mContext *上下文 */public static void openKeybord(EditText mEditText, Context mContext){InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);imm.showSoftInput(mEditText, InputMethodManager.RESULT_SHOWN);imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,InputMethodManager.HIDE_IMPLICIT_ONLY);}/** * 关闭软键盘 * * @param mEditText *输入框 * @param mContext *上下文 */public static void closeKeybord(EditText mEditText, Context mContext){InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);imm.hideSoftInputFromWindow(mEditText.getWindowToken(), 0);}}

,如果我们想要更多的玫瑰花,就必须种植更多的玫瑰树。

和键盘操作相关的工具类KeyBoardUtils

相关文章:

你感兴趣的文章:

标签云: