无法创建Seek Bar start&这样的终点

时间:2014-04-11 11:11:20

标签: android xml

在我的应用程序中,我已经自定义了SeekBar。但无法更改两种结束样式。

我想创建这样的[两端] enter image description here

这是我的XML代码

<com.example.androidtesting.VerticalSeekBar
    android:id="@+id/verticalSeekbar"
    android:max="100"
    android:layout_width="wrap_content" 
    android:layout_height="fill_parent"
    android:progressDrawable="@drawable/progress"
    android:layout_marginLeft="10dp"
    android:progress="5" 
    android:thumb="@drawable/thumb"/>

这是progress.xml

<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape="line">
<stroke android:width="12dp" android:color="#33CCFF" />
</shape>

我可以知道实现目标的正确方法是什么?

1 个答案:

答案 0 :(得分:1)

试试这段代码:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
  android:shape="line" >
   <corners 
        android:radius="100dp"/>
   <solid
    android:color="#3E9EDE"/>
   <size
    android:width="250dp"
    android:height="25dp"/>
 </shape>