移除 SeekBar 阴影 [英] Remove SeekBar shadow
本文介绍了移除 SeekBar 阴影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
由于某种奇怪的原因(黑暗但不是黑色部分),我的 SeekBar 和拇指后面有一个随机阴影.我该如何摆脱它?
I'm getting a random shadow behind my SeekBar and thumb for some strange reason (the dark but not the black part). How do I get rid of it?
我的搜索栏:
<SeekBar android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/slider"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:max="10"
android:thumb="@drawable/thumb"
android:progressDrawable="@drawable/progress_appearance"/>
thumb.xml
<?xml version="1.0" encoding="UTF-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#ffffffff"
android:endColor="#ffffffff"/>
<size android:height="20dp" android:width="20dp"/>
</shape>
progress_appearance.xml(有一些我还没有删除的奇怪渐变)
progress_appearance.xml (has some weird gradient that I haven't removed yet)
<?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:paddingTop="3px"
android:paddingBottom="3px">
<shape>
<corners android:radius="100dip" />
<gradient
android:startColor="#000"
android:centerColor="#000"
android:endColor="#000"
android:centerY="0.2"
android:angle="270"/>
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="0dip" />
<gradient
android:startColor="#000"
android:centerColor="#000"
android:endColor="#000"/>
</shape>
</clip>
</item>
</layer-list>
推荐答案
试试这个:
<SeekBar android:layout_width="fill_parent"
android:layout_height="wrap_content"
/////
android:background="@null"
/////
android:id="@+id/slider"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:max="10"
android:thumb="@drawable/thumb"
android:progressDrawable="@drawable/progress_appearance"/>
这篇关于移除 SeekBar 阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文