繁体   English   中英

如何控制 android 中 keyPreviewLayout 的外观?

[英]How can I control the look and appearance of the keyPreviewLayout in android?

我是 Android 的初学者,我正在尝试制作键盘,但我想以更漂亮的方式显示 keyPreviewLayout,但我做不到,我想显示它以便它免费并出现从顶部甚至在键盘之外

我的键盘

我希望它是这样的

我的键盘Preview.xml

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:textAlignment="center"
    android:textStyle="bold"
    android:textSize="30sp"
    android:background="#eee"
    android:id="@+id/textPreview"
    android:elevation="2dp">
</TextView>

我的键盘View.xml

<?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_view"
    android:keyPreviewLayout="@layout/keyboard_preview"
    android:layout_alignParentBottom="true"
    android:keyBackground="@color/bbb"
    android:background="#bbb"
    android:keyPreviewOffset="50dp">

</android.inputmethodservice.KeyboardView>

请帮助我,我是 Android 的新手

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM