0

私はいくつかのサンプル アプリケーションを開発している Android で少し遊んでいて、乗り越えられない問題に遭遇しました。SeekBar ビューの「バー」の幅を変更したいです。

私が欲しいものは、提供されたスクリーンショットでよく見ることができます

http://i.stack.imgur.com/XczAf.png

とても親切で私を助けてくれませんか?

事前にどうもありがとう

4

2 に答える 2

1

サムドローアブルを使用して高さとサム画像を変更できます シークバーxmlファイルで以下の行を使用します

android:thumb="@drawable/seekbar_thumb_draw"



<SeekBar
android:id="@+id/seekBar1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:thumb="@drawable/seekbar_thumb_draw" />

//seekbar_thumb_draw.xml

<?xml version="1.0" encoding="utf-8"?>

<item>
    <shape>
        <size
            android:height="40dp"
            android:width="40dp" />

        <solid android:color="@android:color/transparent" />
    </shape>
</item>
<item android:drawable="@drawable/seekbar_thumb_image"/>

seekbar_thumb_image は、必要な親指の画像です

于 2015-12-23T07:12:36.800 に答える
0

あなたが望む正確なサイズをフォトショップします。次に、それをドローアブルフォルダに保存します。次に、シークバーのxmlコードでそれを参照します。

<SeekBar
        android:id="@+id/seekBar1"
        android:layout_width="wrap_contentt"
        android:layout_height="wrap_content"
        android:thumb="@drawable/seek_thumb_verywidebar" />
于 2012-04-18T23:54:17.187 に答える