customize soft keyboard key preview

此生再无相见时 提交于 2019-12-07 15:23:25

Use something like this in your keys XML layout:

<Key android:codes="97" android:keyIcon="@drawable/key_icon" android:iconPreview="@drawable/key_preview_icon" /> 

It worked for me. I hope this helps you :)

Shobhit Sagar

You may have created a android.inputmethodservice.KeyboardView.xml layout resource file

Use android:keyBackground="#FF419F3C"

<?xml version="1.0" encoding="utf-8"?>
<android.inputmethodservice.KeyboardView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="wrap_content"
    android:id="@+id/keyboard"
    android:labelTextSize="20dp"
    android:background="@color/colorTrybg"        
    android:keyTextColor="@color/colorTrykey"
              <!-- This one -->
    android:keyBackground="#FFFFFF"
    android:layout_alignParentBottom="true"
    android:keyPreviewLayout="@layout/preview">
</android.inputmethodservice.KeyboardView>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!