zoukankan      html  css  js  c++  java
  • Android如何让软键盘出现和消失

    在程序中加入以下代码时,软键盘会出现:

    InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);     
    imm.toggleSoftInput(0, InputMethodManager.RESULT_SHOWN);  
    如果要让软键盘消失,则为以下代码:
     

    InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);

    imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);  
  • 相关阅读:
    java+selenium自动化-IE浏览器搭建自动化环境
    python中的opencv
    随机森林参数说明
    剑指offer
    Python中常用的包--sklearn
    Anaconda安装,jupyter notebook 使用说明
    C++中的Public 、Private、Protected 区别
    C++类中的Static关键字二
    C++类中的Static关键字
    c语言二级指针内存模型
  • 原文地址:https://www.cnblogs.com/yangzhenyu/p/2192737.html
Copyright © 2011-2022 走看看