【问题标题】:Can I create the Input method picker fullscreen?我可以创建全屏输入法选择器吗?
【发布时间】:2017-04-30 21:36:36
【问题描述】:

我正在使用下面的代码,打开选择器来更改输入法,我的要求是全屏创建或自定义它..

InputMethodManager im = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
im.showInputMethodPicker();

它会打开一个对话框..

想要的输出:

我没有找到任何相同的例子? 谢谢

【问题讨论】:

    标签: android android-input-method


    【解决方案1】:

    我相信您需要的是手机上所有启用的 IME 的列表,以及切换到一个选定的全屏/对话框/任何可能是您的 UI 实现的方法,这无关紧要。

    要获取启用的 IME 的列表,请尝试以下操作:

    InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
    List<InputMethodInfo> mInputMethodProperties = imm.getEnabledInputMethodList();
    

    获得输入方法列表后,您可以在任何类型的对话框中按名称显示它们,然后使用InputMethodService 类中提供的void switchInputMethod (String id) 函数切换到选定的方法。可以从您之前检索到的 InputMethodInfo 对象中提取特定 ime 的 id

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-29
      • 2016-05-04
      • 2019-11-09
      • 2021-06-12
      • 1970-01-01
      相关资源
      最近更新 更多