无法创建像这样的起始点和结束点的进度条

3

在我的应用程序中,我已经自定义了 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
请尝试使用此工具:http://angrytools.com/android/button/ - MilapTank
使用9 patch可绘制对象。 - pskink
你想要两边都是圆角吗? - MilapTank
1个回答

1

try this code :

<?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> 

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接