【问题标题】:unable to apply glow effect at the progress bar无法在进度条上应用发光效果
【发布时间】:2014-04-26 10:07:41
【问题描述】:

我正在尝试在进度条上应用发光效果。我正在使用 png 图像来显示发光效果,但它不会随着加载的进行而移动。任何帮助将不胜感激。谢谢。

mydrawable.xml :-

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:id="@android:id/background"
      >
        <shape>
            <corners android:radius="20dip"
               />
            <gradient
                    android:startColor="#434343"
                    android:centerColor="#ffffff"

                   android:endColor="#434343"
                    android:angle="270"


            />
            <!-- gradient
                    android:startColor="#ff9d9e9d"
                    android:centerColor="#ff5a5d5a"
                    android:centerY="0.75"
                    android:endColor="#ff747674"
                    android:angle="270"
                     android:centerColor="#0040F8"
                     android:endColor="#00F810"
          /-->

        </shape>
    </item>

    <item android:id="@android:id/secondaryProgress">

        <clip>
            <shape>
                <corners android:radius="20dip" />
                <gradient
                        android:startColor="#F80070"
                        android:centerColor="#00F810"
                        android:centerY="0.75"
                        android:endColor="#F88000"
                        android:angle="270"

                />
            </shape>
        </clip>
    </item>

 <item android:id="@android:id/progress">

        <clip>
            <shape>
                <corners android:radius="20dip" />
                <gradient
                        android:startColor="#F80070"
                        android:centerColor="#FFFF00"
                        android:centerY="0.75"
                        android:endColor="#F88000"
                        android:angle="0"

                />
            </shape>
        </clip>

    </item>

 <item >
    <bitmap

        android:antialias="true"
        android:gravity="right|bottom|fill_vertical"
        android:src="@drawable/glow1" />
</item>   

</layer-list>

【问题讨论】:

    标签: android user-interface progress-bar


    【解决方案1】:

    你必须像这样在你的xml中使用drawable:

    <item android:id="@android:id/progress">
            <scale android:scaleWidth="100%"
                   android:drawable="@drawable/glow1" />
        </item>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-19
      • 1970-01-01
      相关资源
      最近更新 更多