这里有一些UI行为我不理解...
我的期望:
实际得到的结果:
我的代码:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/black_to_white" />
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/blue_to_red" />
</LinearLayout>
背景代码:(两个代码相同,除了颜色)
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#000000"
android:endColor="#ffffff"
android:angle="270" />
</shape>
我该如何让我的第二个渐变从屏幕中间开始呈蓝色?
(我注意到这种渐变在Android 3.0视图模式下运行良好,但在其他版本上不行)