2017-08-29 2 views
0

My abgetönte durchschein SeekBar rendert unterschiedlich in API 25, wie in API 21.SeekBar mit transluzenten Daumen überlappende

Code:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:background="@color/md_green_500" 
       android:orientation="vertical" 
       android:padding="16dp"> 

    <SeekBar 
     android:id="@+id/seek" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:progress="10" 
     android:progressBackgroundTint="@android:color/transparent" 
     android:progressTint="?android:attr/textColorSecondary" 
     android:thumbTint="?android:attr/textColorSecondary"/> 

</LinearLayout> 

screenshots

Von links:

  1. API 21
  2. API 21, android:splitTrack="false"
  3. API 25
  4. API 25, android:splitTrack="false"

Was ich versuche zu tun: die dritte SeekBar

  • Ich möchte gleich dem ersten sein - der Fortschrittsbalken sollte am Stern enden t des Daumens, nicht irgendwo darunter

  • Idealerweise möchte ich die Alpha-Compositing-Modi PorterDuff.Mode verwenden können. (Ziel über)

Antwort

0

Ich habe das Problem ganz anders gelöst.

  1. I set all den Farbton zu schwarz:

    android:progressTint="@android:color/black" 
        android:thumbTint="@android:color/black" 
    
  2. I zugegebenen Opazität Attribute und den Wert auf 0.54 (secondary text opacity)

    android:alpha="0.54" 
    

Und schließlich it works! :)

Verwandte Themen