我不明白你真正的意思,但我可以從你說做什麼我做 嘗試使用不同的drawbles
讓我告訴你一個例子什麼理解:
你code
的.java
import android.os.Bundle;
import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.widget.SeekBar;
public class MainActivity extends Activity {
private SeekBar seekBar1;
private SeekBar seekBar2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
seekBar1 = (SeekBar) findViewById(R.id.seekBar1);
seekBar2 = (SeekBar) findViewById(R.id.seekBar2);
seekBar1.setProgress(15);
seekBar2.setProgress(55);
Drawable ii = getResources().getDrawable(R.drawable.ii);
// Drawable iii = getResources().getDrawable(R.drawable.ii);
seekBar1.setThumb(ii);
seekBar2.setThumb(ii);
}
}
您的問題:
你可以做的是simple
只是重命名同一繪製這樣的:
import android.os.Bundle;
import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.widget.SeekBar;
public class MainActivity extends Activity {
private SeekBar seekBar1;
private SeekBar seekBar2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
seekBar1 = (SeekBar) findViewById(R.id.seekBar1);
seekBar2 = (SeekBar) findViewById(R.id.seekBar2);
seekBar1.setProgress(15);
seekBar2.setProgress(55);
Drawable ii = getResources().getDrawable(R.drawable.ii);
Drawable iii = getResources().getDrawable(R.drawable.ii);
seekBar1.setThumb(ii);
seekBar2.setThumb(iii);
}
}
這就是結果:
是遇到了一些後顯示與AbsSeekbar其可能的來源,但你可以plaese讓我知道使用這個實現的任何來源。 –
@SreedevR你可以在這裏看看AbsSeekbar的源代碼:http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/1.5_r4/android/widget/ AbsSeekBar.java#AbsSeekBar瞭解如何繪製拇指以及如何設置位置。 – Bolton
@Sreedev R確切位置的意思就像圖中所示.. ??離實際過程稍遠? – TheFlash