android 渐变背景

<?xml version="1.0" encoding="utf-8"?>
<layer-list
  xmlns:android="http://schemas.android.com/apk/res/android">
  <item>
    <shape>
      <gradient
        android:startColor="#ffa6a6a6"
        android:centerColor="#ffdbdbdb"
        android:endColor="#ffe7e7e7"
        android:height="1px"
        android:angle="90"
        android:dither="true" />
    </shape>
  </item>
</layer-list>

angle渐变角度
dither是一种故意造成的噪音用以随机化量化误差,阻止大幅度拉升图像时导致的像banding(色带)这样的问题

猜你喜欢

转载自staroflife.iteye.com/blog/1748074