How to set Android SeekBar progress drawable programmatically
问题 I have a problem with programmatically setting the progress drawable of a SeekBar. When I set it in the .xml file everything is working fine. <SeekBar android:id="@+id/sb" android:layout_width="fill_parent" android:layout_height="wrap_content" ..... android:progressDrawable="@drawable/seek_bar"/> But, I have a problem when I try to set it from code like this: seekBar.setProgressDrawable(getResources().getDrawable(R.drawable.seek_bar)); Background drawable then takes the whole seek bar, and I