2
我正在自定义Android中HORIZONTAL ProgressBar的外观,并且必须使用三种不同的图像,一种用于背景,一种用于辅助进度,另一种用于进度。ProgressDrawable图层列表的图像应该是什么样子?
我的猜测是,背景必须是一个实际的完整条形图进度填充,像灰色栏图像匹配ProgressBar视图布局的宽度和高度尺寸?
其他的呢?
我正在自定义Android中HORIZONTAL ProgressBar的外观,并且必须使用三种不同的图像,一种用于背景,一种用于辅助进度,另一种用于进度。ProgressDrawable图层列表的图像应该是什么样子?
我的猜测是,背景必须是一个实际的完整条形图进度填充,像灰色栏图像匹配ProgressBar视图布局的宽度和高度尺寸?
其他的呢?
看的progress_horizontal.xml如何在Android的核心定义 - 您可以使用它作为参考:
<?xml version="1.0" encoding="UTF-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@id/background">
<shape>
<corners android:radius="5.0dip" />
<gradient android:startColor="#ff9d9e9d" android:endColor="#ff747674" android:angle="270.0" android:centerY="0.75" android:centerColor="#ff5a5d5a" />
</shape>
</item>
<item android:id="@id/secondaryProgress">
<clip>
<shape>
<corners android:radius="5.0dip" />
<gradient android:startColor="#80ffd300" android:endColor="#a0ffcb00" android:angle="270.0" android:centerY="0.75" android:centerColor="#80ffb600" />
</shape>
</clip>
</item>
<item android:id="@id/progress">
<clip>
<shape>
<corners android:radius="5.0dip" />
<gradient android:startColor="#ffffd300" android:endColor="#ffffcb00" android:angle="270.0" android:centerY="0.75" android:centerColor="#ffffb600" />
</shape>
</clip>
</item>
</layer-list>
完美。我以前曾经访问过它,但已经忘记了。你能告诉我如何找到Android源代码? – joepetrakovich 2010-12-12 15:28:24
我想有很多种方法,可以在网上找到它(或从Android Git回购中查看它)。但我所做的只是用apktool(http://code.google.com/p/android-apktool/) – 2010-12-12 15:32:20
http解包C:\ android-sdk-windows-r04 \ platforms \ android-8 \ android.jar ://android.git.kernel.org – adamp 2010-12-12 19:31:54