0

I have the following xml:

<SeekBar android:id="@+id/sk"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:max="120"
    android:background="#44ff0000"
    android:paddingLeft="0dp"
    android:paddingRight="0dp"
    />

Why the seekbar still has spaces as the picture shows, how can I make them disappear?

the picture

Codor
  • 17,447
  • 9
  • 29
  • 56
Tiger Wang
  • 119
  • 9

2 Answers2

0

Use following lines in java.

SeekBar sk = (SeekBar)findViewByID(R.id.sk);
sk.setPadding(0,0,0,0);
Rohit
  • 2,646
  • 6
  • 27
  • 52
0

Just use these 2 lines in your Seekbar xml

android:paddingStart="0dp"
android:paddingEnd="0dp"

Answere in: https://stackoverflow.com/a/42509109/5819451

Barno
  • 766
  • 7
  • 15