---
title: "ProgressBar进度条效果设置"
author: "test_angel"
date: "2016-04-28T17:12:39Z"
tags: []
categories: ["移动开发"]
slug: "progressbar"
draft: false
lastmod: "2016-04-28T17:12:39Z"
id: 2294660
url: "https://test-angel.iteye.com/blog/2294660"
---

今天在修改进度条的页面展示，就按照网上说的写一个drawable如下：

&lt;?xml version="1.0" encoding="UTF-8"?&gt;  

&lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt;  

        &lt;item android:id="@android:id/background" android:drawable="@drawable/slide\_bg" /&gt;   

        &lt;item android:id="@android:id/progress"  android:drawable="@drawable/slide"/item&gt;

&lt;/layer-list&gt;

这时我的进度条展示出来只有下面这个slide，试了N久都不可行，最后经过多方查找，最终确定上面的xml应该这样写：

&lt;?xml version="1.0" encoding="UTF-8"?&gt;  

&lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt;  

        &lt;item android:id="@android:id/background" android:drawable="@drawable/slide\_bg" /&gt;   

        **&lt;item android:id="@android:id/progress"&gt;**  

            **&lt;clip android:drawable="@drawable/slide"/&gt;**  

            **&lt;/item&gt;**

&lt;/layer-list&gt;

 

修改成下面这个方式就ok啦，大功告成！