2016-04-29 9 views
0

machen wie Tab-Layout transparent auf Bild Slider machen ... hier ist mein Layout, wo ich Tab-Layout deklariert ... Ich suchte viel, aber ich habe keine Lösung für diese .. .wie tablayout transparent auf Bild-Slider

<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <android.support.design.widget.TabLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginTop="150dp" 
     android:id="@+id/tablayout" 
     android:textAllCaps="false" 
     android:background="#db000000" 
     app:tabMode="fixed" 
     app:elevation="0dp" 
     app:tabGravity="fill" 
     app:tabTextColor="#FFFFFF" 
     app:tabSelectedTextColor="#EF9C1A" 
     android:tabStripEnabled="true" 
     > 
    </android.support.design.widget.TabLayout> 
</RelativeLayout> 

like in this image..

my app is like this

+0

Sie bitte Ihre MainActivity Code an, wo Sie tabLayout erklärt – Asama

Antwort

1

Stellen sie einfach android:background zu #70000000 es ist. Dadurch wird es halbtransparent. Ändern Sie einfach den Wert 70 in etwas, das Ihnen besser passt. 99 ist verdunkelt. 10 ist transparent (leichter)

Edit: für die es völlig transparent verwenden nur android:background="@android:color/transparent"

+0

dies nicht funktionieren ... es in hellgraue Farbe ändern, wenn i Set .. –

+0

Sie wollen es also komplett transparent? Aus dem Bild "wie in diesem Bild" ist es halbtransparent, also dachte ich mir .. nebenbei setzte ich die Hintergrundfarbe auf @android: color/transparent – Asama

+0

ich habe es schon ausprobiert ... es macht es weiß..nicht transparent .. –