Android-自定义标题栏渐变问题
我想创建一个自定义渐变并将其应用于线性布局的背景 下面是渐变的代码:Android-自定义标题栏渐变问题,android,gradient,titlebar,linear-gradients,Android,Gradient,Titlebar,Linear Gradients,我想创建一个自定义渐变并将其应用于线性布局的背景 下面是渐变的代码: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="#31527B" android:end
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#31527B"
android:endColor="#20426F"
android:angle="270"/>
</shape>
我需要一个如下所示的渐变:
不知何故,我没有得到这种效果。我是否在角度等方面做错了什么/我是否需要对渐变应用更多属性?尝试将角度设置为90,这里有一个示例 还有一个:
希望这有帮助…尝试将角度设置为90,这里有一个示例 还有一个: 希望这有助于