我创建了一个名为customprogressbar.xml的XML文件在你的水库>绘制文件夹:如何使指标图像自定义进度栏,如whatsapp?
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Define the background properties like color etc -->
<item android:id="@android:id/background">
<shape>
<gradient
android:startColor="#000001"
android:centerColor="#0b131e"
android:centerY="1.0"
android:endColor="#0d1522"
android:angle="270"
/>
</shape>
</item>
<!-- Define the progress properties like start color, end color etc -->
<item android:id="@android:id/progress">
<clip>
<shape>
<gradient
android:startColor="#007A00"
android:centerColor="#007A00"
android:centerY="1.0"
android:endColor="#06101d"
android:angle="270"
/>
</shape>
</clip>
</item>
</layer-list>
而且
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleHorizontal"
android:progressDrawable="@drawable/custom_progressbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
现在我有颜色,但我需要把指示器图像,在填充物之间并保持。
任何想法?
你究竟是什么考虑指标图像是?哪个指标为什么? –
如果您看到屏幕截图,您可以在填充和保留之间看到一个点。 – Cabezas