2017-02-28 2 views
0

Ich zeige eine transparente Hintergrundaktivität oben auf meiner Android Hauptaktivität. Diese transparente Aktivität hat einige Animationen und markiert den Teil eines Hauptbildschirms mit 100% transparentem Farbhintergrund.Onboarding für neue Benutzer anzeigen

Auf diese Weise kann ich mehr über die Funktion für Neulinge informieren.

Die einzige Sache, die ich nicht weiß, ist, wie man den hervorgehobenen Teil ohne 20% schwarze Farbe zeigt.

enter image description here

Mein Android-Layout ist:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/backgroundView" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@color/black_20"> 

    <LinearLayout 
     android:id="@+id/contentView" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerInParent="true" 
     android:orientation="vertical"> 

     <TextView 
      android:id="@+id/textViewSuccess" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center_horizontal" 
      android:layout_marginTop="24dp" 
      android:background="@color/accent" 
      android:gravity="center_horizontal" 
      android:padding="20dp" 
      android:text="Use estimation cards for your user stories." 
      android:textColor="#ffff" 
      android:visibility="invisible" /> 

     <Button 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center_horizontal" 
      android:text="Got it." /> 

    </LinearLayout> 

    <ImageView 
     android:id="@+id/imageView" 
     android:layout_width="160dp" 
     android:layout_height="160dp" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentStart="true" 
     android:src="@drawable/ic_user_estimation" 
     android:visibility="visible" /> 

</RelativeLayout> 
+0

Eine Sache ist, Sie können das gleiche Layout in transparente Aktivität verwenden und nur diejenigen sichtbar machen, die Sie markieren und andere unsichtbar setzen möchten. –

Antwort

0

Try Code unten

<ImageView 
     android:id="@+id/imageView" 
     android:background="@color/colorBlackShaded" 
     android:layout_width="160dp" 
     android:layout_height="160dp" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentStart="true" 
     android:src="@drawable/ic_user_estimation" 
     android:visibility="visible" /> 

und

<color name="colorBlackShaded">#33000000</color> 

Sie die Transparenz per yo ändern u Anforderung unter snipet mit wie für 20% schwarz Verwendung für Transparenz und für schwarze Farbe

100% — FF 
    95% — F2 
    90% — E6 
    85% — D9 
    80% — CC 
    75% — BF 
    70% — B3 
    65% — A6 
    60% — 99 
    55% — 8C 
    50% — 80 
    45% — 73 
    40% — 66 
    35% — 59 
    30% — 4D 
    25% — 40 
    20% — 33 
    15% — 26 
    10% — 1A 
    5% — 0D 
    0% — 00 
Verwandte Themen