【问题标题】:How can I edit the source code of android os keyboard?如何编辑android os键盘的源代码?
【发布时间】:2013-01-21 19:38:48
【问题描述】:

我使用的是安卓键盘,但我想给它添加一行按键,所以我从https://android.googlesource.com/platform/packages/inputmethods/LatinIME/下载了这个键盘的源代码,但我遇到了以下错误

import com.android.inputmethodcommon 无法解析

import com.android.inputmethodcommon.InputMethodSettingsFragment;

【问题讨论】:

    标签: android


    【解决方案1】:

    您可以在 Android 中创建自己的自定义键盘来显示任何数字或键。使用KeyboardKeyboard.RowKeyboard.Key

    如需更多自定义键盘,请查看blog post

    【讨论】:

      【解决方案2】:

      我不知道你是否还需要这方面的帮助,但你不需要 imePreferences 文件,你可以删除它。您想转到 xml 文件夹和 qwerty.xml 文件,您可以在其中添加和更改行和键。 只需用你想要的键添加一行。

      <Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
      android:keyWidth="10%p"
      android:horizontalGap="0px"
      android:verticalGap="0px"
      android:keyHeight="@dimen/key_height"
      >
      
      <Row>
          <Key android:codes="113" android:keyLabel="q" android:keyEdgeFlags="left"/>
          <Key android:codes="119" android:keyLabel="w"/>
          <Key android:codes="101" android:keyLabel="e"/>
          <Key android:codes="114" android:keyLabel="r"/>
          <Key android:codes="116" android:keyLabel="t"/>
          <Key android:codes="121" android:keyLabel="y"/>
          <Key android:codes="117" android:keyLabel="u"/>
          <Key android:codes="105" android:keyLabel="i"/>
          <Key android:codes="111" android:keyLabel="o"/>
          <Key android:codes="112" android:keyLabel="p" android:keyEdgeFlags="right"/>
      </Row> 
      

      【讨论】:

        猜你喜欢
        • 2017-07-27
        • 1970-01-01
        • 2012-07-25
        • 2020-07-18
        • 1970-01-01
        • 2014-03-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多