I am trying to create a custom Android keyboard. I want to put a TextView right on top of KeyboardView.
Here's the XML. On this layout, the TextView displays on the very top of the screen. But I want to put it right on top of the keyboard, regardless the height of the keyboard. I tried playing around with layout_align*
, but can't seem to do it.
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/input_view"
android:layout_height="wrap_content"
android:layout_width="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Hello World" />
</LinearLayout>
<android.inputmethodservice.KeyboardView
android:id="@+id/keyboard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:keyPreviewLayout ="@layout/keyboard_preview"
/>
</RelativeLayout>
Here's the screenshot.