AppCompatSeekBar удаление левого и правого отступа?

см. изображение

     <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <com.SocialMob.CustomViews.CustomTextView
                android:id="@+id/textViewCurrentDurationMusic"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:padding="@dimen/_3sdp"
                android:singleLine="true"
                android:text="01:00"
                android:textColor="#AEAEAE"/>

            <android.support.v7.widget.AppCompatSeekBar
                android:id="@+id/seekBarMusic"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:max="100"
                android:paddingLeft="0px"
                android:thumbOffset="-1px"
                android:paddingRight="0px"
                android:progress="60"
                android:layout_margin="0dp"
                app:theme="@style/SeekBarTheme"
                app:paddingEnd="0px"
                app:paddingStart="0px" />

            <com.SocialMob.CustomViews.CustomTextView
                android:id="@+id/textViewTotalDurationMusic"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="end"
                android:padding="@dimen/_3sdp"
                android:text="05:00"
                android:textColor="#AEAEAE"/>
        </LinearLayout>

Я делаю приложение музыкального плеера, в котором есть SeekBar, я хочу удалить дополнительные отступы в обоих концах SeekBar. Я пробовал 0 отступов, 0 полей, -ve отступов и -ve полей.

2 ответа

Решение

Почему бы не попробовать изменить его с помощью java code.try следующего примера кода.

 seekBar.setPadding(0, 0, 0, 0);

Это может вам помочь.

Установите следующие атрибуты.

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

Другие вопросы по тегам