I have found a problem with SeekBar. On devices with Android 4,5,6 I do not have such problem, but on Samsung S8 with Android 7 problem with progress line occurs. If I remove rotation parameter, SeekBar becomes horizontal and problem disappears, but I need standard vertical SeekBar. Update: the same problem on Nexus emulator API 24 (Android 7). I have attached 2 screen shots from my app running on Android 6 (LG, Sony) and Android 7 (Samsung S8) and code:
<SeekBar android:id="@+id/seekBar"
android:layout_width="100dp"
android:layout_height="42dp"
android:background="#20FFFFFF"
android:rotation="270"
android:layout_gravity="center"
>
</SeekBar>
and full code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/icon"
android:layout_width="42dp"
android:layout_height="24dp"
android:paddingTop="6dp"
android:background="#20FFFFFF"
android:layout_gravity="center"
android:src="@drawable/iconvolume" />
<LinearLayout
android:layout_width="42dp"
android:layout_height="100dp"
android:gravity="center">
<SeekBar android:id="@+id/seekBar"
android:layout_width="100dp"
android:layout_height="42dp"
android:background="#20FFFFFF"
android:rotation="270"
android:layout_gravity="center"
>
</SeekBar>
</LinearLayout>
</LinearLayout>
i've got this problem, after try many many approach, i was found solution. Just add android:layerType="hardware"
or android:layerType="software"
will solve your problem
<SeekBar android:id="@+id/seekBar"
android:layout_width="100dp"
android:layout_height="42dp"
android:background="#20FFFFFF"
android:rotation="270"
android:layerType="hardware"
android:layout_gravity="center"
>
</SeekBar>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With