我正在尝试让一个条形图淡入到我的RelativeLayout的背景中。基本上从后面开始,然后渐变为透明。你懂的。
这是我现在拥有的xml:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="@color/black_translucent"
android:endColor="#323232"
android:angle="90"
android:type="linear"
android:useLevel="true"
/>
</shape>
我应用此操作的视图:
<View
android:layout_width="fill_parent"
android:layout_height="40dp"
android:background="@drawable/gradient_top" />
问题: 视图底部有一个尖锐的边缘。我很困惑,因为渐变是透明结束的。但是我仍然在视图的底部得到了一个尖锐的边缘。如何调整才能获得淡出的边缘?