android seekbar progressdrawable:背景位图不拉伸(高度)

Eug*_*mak 5 android seekbar

我的布局xml如下:

 <SeekBar
        android:id="@+id/progress"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_margin="10dp"
        android:gravity="center"
        android:progressDrawable="@drawable/progressbar_drawable"
        android:progress="50"
        android:thumb="@drawable/progressbar_handle_selector"
        android:layout_toLeftOf="@+id/showChat"
        android:layout_toRightOf="@+id/play" />
Run Code Online (Sandbox Code Playgroud)

Seekbar的可绘制进度如下:

@ drawable / progressbar_drawable

  <?xml version="1.0" encoding="utf-8"?>
  <layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

  <item android:id="@android:id/background" android:drawable="@drawable/bg_progressbar_9patch"/>
  <item android:id="@android:id/progress">
    <clip>
        <shape>
            <gradient
                android:angle="90"
                android:endColor="#d9b546"
                android:startColor="#cc520f" />
        </shape>
    </clip>
  </item>

  </layer-list>
Run Code Online (Sandbox Code Playgroud)

结果,背景位图(白色的)与可绘制的进度条(橙色的)相比,高度不拉伸,并且仍然过低,下面是一个示例: 在此处输入图片说明

而且,在不同的屏幕上它看起来也不同:背景位图与可绘制进度相比具有不同的高度。例如(另一个屏幕):

在此处输入图片说明

我的问题是:为什么进度和背景可绘制对象(橙色和白色条纹)不总是相同的高度?如何使它们具有相同的高度?


更新

Png资源:

在此处输入图片说明 在此处输入图片说明

Leo*_*dos 1

我从你的图像创建了 9-patch 并将其放入 drawable-hdpi 文件夹中,一切看起来都很好...我在 eclipse ui 预览器中有一些工件,但设备上一切正常... 在此输入图像描述

https://dl.dropbox.com/u/13106986/bg_progressbar_patch.9.png