How do I get the thumb of an Android SeekBar to match the height of the SeekBar?

前端 未结 2 559
小鲜肉
小鲜肉 2020-12-17 06:24

Do I need to implement a custom thumb Drawable?

2条回答
  •  [愿得一人]
    2020-12-17 07:02

    With some digging, I found how to supply a custom Drawable thumb. Here's an excerpt that may help others.

      ShapeDrawable thumb = new ShapeDrawable( new RectShape() );
      thumb.getPaint().setColor( 0x00FF00 );
      thumb.setIntrinsicHeight( 80 );
      thumb.setIntrinsicWidth( 30 );
      mySeekBar.setThumb( thumb );
    

提交回复
热议问题