SoftKeyboard 示例字体/按键背景模糊问题

发布于 2024-10-06 17:29:05 字数 417 浏览 4 评论 0原文

我是 Android 开发新手,很抱歉可能问了一个愚蠢的问题。

我要写一个简单的软键盘。我从以下开始 样本: http://developer.android.com/resources/samples/SoftKeyboard/index.html

当我在模拟器(WVGA800,240 dpi,Android 2.2)上编译并启动它时,我 注意到关键形状和字体是模糊的。当我开仓时 Android 软键盘按键及其字体都很完美。我试过 将此键盘(来自示例)安装到我的 htcdesire hd 并 键/字体的质量与模拟器上一样差。

我怎样才能达到与普通键盘相同的质量。

I am new to android development, so sorry for maybe a stupid question.

I am going to write simple soft keyboard. I started with the following
sample:
http://developer.android.com/resources/samples/SoftKeyboard/index.html

When I compiled and launched it on emulator (WVGA800, 240 dpi, Android 2.2) I
noticed that key shapes and font is blurry. When I opened stock
android soft keyboard keys are perfect as well as their font. I tried
to install this keyboard (from the sample) to my htc desire hd and
quality of keys / fonts was bad as on the emulator.

How can I achieve the same quality as stock keyboard has.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

权谋诡计 2024-10-13 17:29:05

这个问题相当老了,但我刚刚遇到了同样的问题,解决了它,但找不到解决方案。

问题是,默认情况下,该键盘被设置为低密度的小键盘。查看此参考以获取更多信息:

http://developer.android。 com/guide/topics/manifest/supports-screens-element.html

以下是解决 AndroidManifest.xml 文件中问题的设置:

<supports-screens android:resizeable="false"
         android:smallScreens="false"
         android:normalScreens="false"
         android:largeScreens="true"
         android:xlargeScreens="true"
         android:anyDensity="true"
         android:requiresSmallestWidthDp="600"
         android:compatibleWidthLimitDp="600"
         android:largestWidthLimitDp="600"/>

This question is rather old, but I just now bumped into the same issue, solved it and could not find a solution.

The issue is that this keyboard, by default, is set for as a small keyboard with a low density. Review this reference for more information:

http://developer.android.com/guide/topics/manifest/supports-screens-element.html

Here are my settings that solved the issue located in the AndroidManifest.xml file:

<supports-screens android:resizeable="false"
         android:smallScreens="false"
         android:normalScreens="false"
         android:largeScreens="true"
         android:xlargeScreens="true"
         android:anyDensity="true"
         android:requiresSmallestWidthDp="600"
         android:compatibleWidthLimitDp="600"
         android:largestWidthLimitDp="600"/>
拥有 2024-10-13 17:29:05

好吧,我找到了答案。

在键盘视图 xml 中放置 android:shadowRadius="0.0"

<android.inputmethodservice.KeyboardView 
...
android:shadowRadius="0.0" />

well i found the answer.

well in the keyboard view xml put android:shadowRadius="0.0"

<android.inputmethodservice.KeyboardView 
...
android:shadowRadius="0.0" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文