【问题标题】:Honeycomb makes texts pixelizedHoneycomb 使文本像素化
【发布时间】:2011-08-14 07:59:56
【问题描述】:

我的应用在我的 Galaxy S 上看起来不错,但是当我在 Galaxy Tab 10.1 (Android 3.0) 上运行它时,文本看起来像素化/模糊:

用于同步按钮的 XML 如下:

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/synchronizeButton"
    android:background="@drawable/button"
    android:text="Synchronize"
    android:textSize="20dp"
    android:textColor="@drawable/buttoncolors"
    android:layout_marginBottom="10dp"/>

是我做错了什么,还是我需要做一些特别的事情才能使我的应用与 Honeycomb 兼容?

【问题讨论】:

    标签: android android-layout rendering android-3.0-honeycomb


    【解决方案1】:

    您的应用程序是否在兼容模式下运行?如果是这样,这是意料之中的。您需要在清单中表明您支持大屏幕。

    【讨论】:

    • 谢谢,就是这样。不知何故,我认为它会自动发生......现在必须重做我的布局:)
    【解决方案2】:

    尝试将 textSize="20dp" 更改为 textSize="20sp"。在处理文本时,您应该始终使用“sp”(与比例无关的像素)。希望这能解决它。

    查看此页面了解更多信息:http://developer.android.com/guide/practices/screens_support.html

    【讨论】:

    • 虽然这通常是合理的建议,但这不是这里的问题。以这种方式使用 dip vs sp 不会影响文本渲染。
    猜你喜欢
    • 1970-01-01
    • 2019-01-28
    • 1970-01-01
    • 2012-02-08
    • 2011-08-16
    • 2020-07-30
    • 1970-01-01
    • 2021-03-30
    • 1970-01-01
    相关资源
    最近更新 更多