我想用自定義seekbar裏面有數字尺度,但是不工作。該搜索欄必須支持所有屏幕分辨率。我怎麼能這樣做。請給出您的寶貴意見。如何在android seekbar中添加數字縮放?
我custom_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"
android:drawable="@drawable/unselect"/>
<item
android:id="@android:id/secondaryProgress"
android:drawable="@drawable/select">
</item>
<item
android:id="@android:id/progress"
android:drawable="@drawable/select">
</item>
activity_main.xml中
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/default_screen_bg"
android:orientation="vertical"
tools:context=".MainActivity" >
<SeekBar
android:id="@+id/seekBar1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:indeterminate="false"
android:max="10"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:progressDrawable="@drawable/custom_seekbar" />
</LinearLayout>
Unselesct.png
select.png
myresult屏幕這樣
我期待這樣的
你的意思是'不工作'是什麼意思?什麼是可繪製/取消選擇等圖像?這些圖像顯示不正確嗎? – sandrstar
@sandrstar是的。選擇和取消選擇圖像不能正確顯示 –