I'm using the AndroidSlidingUpPanel. I'm trying to make one of the views semi-transparent. So that you can see what's under it. So its basically a LinearLayout which moves, but I can't see whats underneath.
I've tried setting the alpha
, the background color (with alpha)
xml settings:
android:background="@android:color/transparent"
as well as:
android:background="#22000000"
I've also tried programmatically:
view.setAlpha((float) 0.45));
The thing is everything I do doesn't make it transparent. I can see the colours change but its still fully opaque.
Perhaps i've missed something? How can I make it transparent so I can see whats underneath
Use android:alpha="0.1" to set opacity of a layout
<FrameLayout
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.2"
android:background="#000000"
https://developer.android.com/reference/android/view/View.html#setAlpha(float)
In XML set Background attribute to any colour White(#FFFFFF) shade or Black(#000000) shade.if you want transparancy just put 80 before the actual hash code.
#80000000
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