如何在Android中更改自定义键盘的键标签大小 [英] How to change the key label size of a custom keyboard in android

查看:383
本文介绍了如何在Android中更改自定义键盘的键标签大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改自定义键盘中键盘标签的大小.我正在使用的代码是这样的,

I want to change the size of the keyboard label in my custom keyboard. The code I am using is like this,

 <Keyboard
     android:keyWidth="%10p"
     android:keyHeight="50px"
     android:horizontalGap="2px"
     android:verticalGap="2px" >
 <Row android:keyWidth="32px" >
     <Key android:keyLabel="A" />
     ...
 </Row>
 ...

问题是,如果我们在键盘上使用字母'A'(标签)上方的代码太小.

So the issue is, if we take the code above the letter 'A'(label) is too small in my keyboard.

KeyBoard类中,我找不到任何xml属性更改键标签的可见大小.

In KeyBoard class I can't find any xml attribute to change the visible size of the key label.

如何更改钥匙标签的尺寸?

How to change the size of the key label?

谢谢.

推荐答案

字符键的文本大小. android:keyTextSize可以帮助您.

Size of the text for character keys. android:keyTextSize can help.

在您的布局xml文件中进行设置,如下所示:

Set this in your layout xml file, like this:

<android.inputmethodservice.KeyboardView
    android:id="@+id/keyboard_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:keyBackground="@drawable/key_background"
    android:keyTextColor="@android:color/white"
    android:keyTextSize="20sp"/>

这篇关于如何在Android中更改自定义键盘的键标签大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆