所有
我找不到之前提出这个问题的任何主题,所以我必须遗漏一些非常容易的东西。我是初学者,正在创建一个inputmethod
。我把锁定屏幕的所有android代码都拉出来,当我在模拟器或三星Galaxy上查看它时,按钮上的字体看起来很完美。但是当我在HTC Sensation上观看它们时,一切都非常像素化。起初我认为问题出在sym_keyboard_numX
图像文件上,但我测试了两件事以确保不是这样:
keyLabel
而不是数字的图像,文字仍然非常像素化。我查看了所有代码,寻找可能影响质量但无法找到任何内容的任何值。我感谢任何帮助!
这是定义键盘的xml文件。您会看到我在大多数按钮中使用keyLabels
并使用一些keyIcons
来测试差异。正如我所说,没有区别。我不知道任何其他对你有用的代码。
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2008, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:keyWidth="33.33%p"
android:horizontalGap="2px"
android:verticalGap="0px"
android:keyHeight="@dimen/password_keyboard_key_height"
>
<Row>
<Key android:codes="49" android:keyLabel="1" android:keyEdgeFlags="left"/>
<Key android:codes="50" android:keyLabel="2"/>
<Key android:codes="51" android:keyLabel="3"/>
</Row>
<Row>
<Key android:codes="52" android:keyLabel="4" android:keyEdgeFlags="left"/>
<Key android:codes="53" android:keyIcon="@drawable/sym_keyboard_num5"/>
<Key android:codes="54" android:keyLabel="6"/>
</Row>
<Row>
<Key android:codes="55" android:keyLabel="7" android:keyEdgeFlags="left"/>
<Key android:codes="56" android:keyLabel="8"/>
<Key android:codes="57" android:keyLabel="9"/>
</Row>
<Row android:rowEdgeFlags="bottom">
<Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_ok"/>
<Key android:codes="48" android:keyLabel="0"/>
<Key android:codes="-5" android:keyIcon="@drawable/sym_keyboard_delete"
android:iconPreview="@drawable/sym_keyboard_feedback_delete"
android:isRepeatable="true" android:keyEdgeFlags="right"/>
</Row>
</Keyboard>
答案 0 :(得分:2)
显然这个问题已经提出过,但我在所有的搜索中都没有遇到过这个问题。可能只是错误的搜索条件。在发布我的问题之前,我甚至查看了所有stackoverflow建议,但其中一个Related
帖子有我的答案:https://stackoverflow.com/questions/6496870/assets-look-grainy-pixelated?rq=1
基本上我必须添加minSdkVersion
(targetSdkVersion
?)和supports-screens
,如下所示:
<supports-screens android:resizeable="true" android:largeScreens="true"/>
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="10"/>