我正在尝试使下面的搜索栏
看起来像这样
我在minheight和maxheight中使用以下xml属性,但拇指没有移动到底部。
minHeight和maxHeight仅影响搜索栏。如何在搜索栏底部获得所需的结果,即拇指。
<SeekBar
android:id="@+id/seekbar_duree"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/eight_dp"
android:layout_marginRight="@dimen/eight_dp"
android:background="@color/fulll_transparent"
android:indeterminate="false"
android:max="48500"
android:maxHeight="60dip"
android:minHeight="60dip"
android:indeterminateDrawable="@android:drawable/progress_indeterminate_horizontal"
android:paddingLeft="@dimen/twenty_sp"
android:thumb="@drawable/nine_patch"
android:progressDrawable="@drawable/progress_bar"
/>
:更新:这是我的全部。我如何使其低于进展
答案 0 :(得分:0)
我使用xml-thumb与seek_thumb.9.png一样,它具有相同的物理大小,例如seekbarlayout上定义的min / maxHeight值
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:constantSize="false">
<item android:state_pressed="true"
android:drawable="@drawable/seek_thumb_pressed_60" />
<item android:state_focused="true"
android:drawable="@drawable/seek_thumb_pressed_60" />
<item android:drawable="@drawable/seek_thumb_60" />
<item >
<shape android:shape="rectangle" />
</item>
</selector>
seekbar-layout也引用了xml-seekbar
<SeekBar
android:id="@+id/seekbar"
android:layout_width="320dp"
android:layout_height="60dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="10dp"
android:max="30"
android:maxHeight="60dp"
android:minHeight="60dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:progress="15"
android:progressDrawable="@drawable/seekbar"
android:secondaryProgress="0"
android:thumb="@drawable/seek_thumb"
android:thumbOffset="0dp" />
使用* .9.png seekbar.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+android:id/background">
<nine-patch
android:dither="true"
android:src="@drawable/seekbar_back_60" />
</item>
<item android:id="@+android:id/progress">
<clip
android:clipOrientation="horizontal"
android:gravity="left">
<shape android:shape="rectangle" />
<nine-patch
android:dither="true"
android:src="@drawable/seekbar_front_60" />
</clip>
</item>
</layer-list>