简体   繁体   中英

Transparent View in android

I am using sliding drawer top to bottom.i have a imageview/view on that sliding drawer 100x100. and on main screen i have a image. i want to make that view on sliding drawer as transparent that i can see image which is on main screen. i am using this code for sliding drawer. in simple words i have 2 view one on one and i want to see pic of first view from second view.

android:background="#TTRRGGBB"

  • RR, GG, BB are the RGB components of the color, respectively

  • TT is the transparency component.

Use TT = 80 (hex) for 50% transparency, FF for no transparency, 00 for fully transparent.

Source : Another Stack Overflow question .

You have to make the content part of your sliding drawer, transparent, you can do something like this;

<SlidingDrawer android:id="@+id/slider"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:handle="@+id/handle" android:content="@+id/content"
        android:background="#eeffae" >

        <ImageView android:id="@+id/handle" android:layout_width="55dp"
            android:layout_height="55dp" android:src="@drawable/handle" />

        <LinearLayout android:layout_width="wrap_content"
            android:layout_height="wrap_content" android:id="@+id/content"
            android:orientation="vertical" android:background="@null">

...
...
</LinearLayout>
</SlidingDrawer>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM