【发布时间】:2010-05-07 19:05:45
【问题描述】:
我正在使用以下可绘制对象:
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
>
<gradient
android:startColor="@color/content_background_gradient_start"
android:endColor="@color/content_background_gradient_end"
android:angle="270"
/>
</shape>
问题是我在 hdpi 设备(如 Nexus One 和 Droid)上出现了严重的条纹,因为渐变从屏幕顶部到底部。
根据http://idunnolol.com/android/drawables.html#shape_gradient,渐变没有“抖动”属性。我可以做些什么来平滑渐变?
注意:向形状添加 dither="true" 似乎不起作用。
【问题讨论】: