【问题标题】:Android - Custom Title Bar Gradient IssueAndroid - 自定义标题栏渐变问题
【发布时间】:2011-12-07 13:53:15
【问题描述】:

我想创建一个自定义渐变并将其应用于 LinearLayout 的背景。

这是渐变的代码:

<?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>

我需要如下所示的渐变:

不知何故,我没有得到这种效果。我在角度等方面做错了吗/我需要对渐变应用更多属性吗?

【问题讨论】:

    标签: android gradient titlebar linear-gradients


    【解决方案1】:

    尝试将角度设置为 90,这里有一个示例 http://www.android10.org/index.php/forums/43-view-layout-a-resource/328-gradient-backgrounds

    还有另一个:Android LinearLayout Gradient Background

    希望这会有所帮助...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-03-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多