Android 手写软键盘

Android 手写软键盘,android,android-softkeyboard,custom-keyboard,handwriting,Android,Android Softkeyboard,Custom Keyboard,Handwriting,我正在开发一个android键盘应用程序,它应该显示绘图画布,而不是普通的基于按键的软键盘。就像我不想实现候选视图或手写识别一样。我的键盘将只接收画布中的文本并将其作为图像发送 然而,经过大量研究,我仍然无法显示画布视图而不是键盘视图。我接着说: 但这会添加一个带有键盘的键盘视图。我不想要数字或字符键盘。我只想让键盘显示一个空白的画布,我可以在那里画画,一旦完成,它应该会发送图像 我也尝试过这样的布局: <?xml version="1.0" encoding="utf-8"?>

我正在开发一个android键盘应用程序,它应该显示绘图画布,而不是普通的基于按键的软键盘。就像我不想实现候选视图或手写识别一样。我的键盘将只接收画布中的文本并将其作为图像发送


然而,经过大量研究,我仍然无法显示画布视图而不是键盘视图。我接着说:

但这会添加一个带有键盘的键盘视图。我不想要数字或字符键盘。我只想让键盘显示一个空白的画布,我可以在那里画画,一旦完成,它应该会发送图像

我也尝试过这样的布局:

<?xml version="1.0" encoding="utf-8"?>
<android.inputmethodservice.KeyboardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/keyboard"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:keyBackground="@drawable/square_rounded"
    android:background="#ffffff">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:id="@+id/mainLinearLayout">

    <RelativeLayout
        android:id="@+id/keyboardLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <Button
            android:layout_width="100dp"
            android:layout_height="50dp"
            android:text="Cancel"
            android:layout_alignParentLeft="true">
        </Button>

        <Button
            android:layout_width="100dp"
            android:layout_height="50dp"
            android:text="Done"
            android:layout_alignParentRight="true">
        </Button>

        <LinearLayout
            android:layout_alignParentTop="true"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

        </LinearLayout>
    </RelativeLayout>
</LinearLayout>
</android.inputmethodservice.KeyboardView>
任何帮助或教程链接将不胜感激

谢谢,
Anand

“我仍然无法显示画布视图而不是键盘视图”--您在该布局中没有
画布
。当您还没有添加画布时,您希望如何显示
画布
。@commonware甚至连按钮都没有显示me@AnandKumar你能解决这个问题吗?你能分享一下解决方案吗?
kv = (KeyboardView)getLayoutInflater().inflate(R.layout.draw_signature, null);
//            keyboard = new Keyboard(this, R.xml.drawing_keyboard);
//            kv.setKeyboard(keyboard);
kv.setOnKeyboardActionListener(this);
kv.setPreviewEnabled(false);
return kv;