简体   繁体   English

Android Seekbar:在拇指周围添加额外空间

[英]Android Seekbar: adding extra space around thumb

I need to keep the size of thumb and other functionalities as default (like scale on touch) but I need to add the space between progress lines:我需要将拇指和其他功能的大小保持为默认值(如触摸缩放),但我需要在进度线之间添加空间:

搜索栏

To add more description: how to widen the purple area without affecting anything else?添加更多描述:如何在不影响其他任何东西的情况下加宽紫色区域? 搜索栏加宽

To my understanding, there is not way to change that gap size without affecting the thumb drawable, So I used a ring <shape> and made it look like an oval, and made it smaller, and had fixed and equal sizes for all <selector> s inside the shape tag.据我了解,没有办法在不影响拇指可绘制对象的情况下更改间隙大小,因此我使用了一个环<shape>并使其看起来像椭圆形,并使其变小,并且所有<selector>的大小固定且相等<selector> s 在形状标签内。

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape
            android:innerRadiusRatio="1000"
            android:shape="ring"
            android:thickness="8dp"
            android:useLevel="false">
            <solid android:color="@color/primary" />
            <size
                android:width="16dp"
                android:height="16dp" />
        </shape>
    </item>
</layer-list>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM