1

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

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

当我在模拟器(WVGA800、240 dpi、Android 2.2)上编译并启动它时,我注意到键的形状和字体是模糊的。当我打开股票 android 软键盘键以及它们的字体时,它们都是完美的。我尝试将此键盘(来自示例)安装到我的 htc 愿望高清和键/字体的质量在模拟器上很差。

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

4

2 回答 2

2

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"/>
于 2012-09-15T02:32:45.607 回答
0

好吧,我找到了答案。

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

<android.inputmethodservice.KeyboardView 
...
android:shadowRadius="0.0" />
于 2020-01-08T16:21:27.960 回答