【发布时间】:2010-02-05 22:44:24
【问题描述】:
【问题讨论】:
标签: android user-interface dithering
【问题讨论】:
标签: android user-interface dithering
来自Android Developers: Widget Design Guidelines:
在某些情况下,设备的像素较低 可能导致视觉条带的深度 和抖动问题。为了解决这个问题, 应用程序开发人员应通过 通过“代理”可绘制资产 定义为 XML:.这种技术 参考原始艺术品,在 本例“background.9.png”,以及 指示设备将其抖动为 需要。
编辑:
示例来源。这是您的res/drawables 目录中的一个xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/title_bar_medium"
android:dither="true" />
【讨论】:
在这段代码中添加android:tileMode="repeat",像这样 -
<?xml version="1.0" encoding="UTF-8"?>
<bitmap
xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/b1"
android:tileMode="repeat"
android:dither="true" />
原因是,在某些设备上它仍然会拉伸图像并且看起来很糟糕,请检查此 Reference here
【讨论】: