Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop click event through a semi transparent background?

I am trying to set a semi-transparent view over another view when user click on a certain button. And at the same time I want my background view not to be clickable. So basically I am setting alpha as 0.9 to my foreground view.

Code

    <RelativeLayout
    android:id="@+id/rl_fg_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#231564"
    android:alpha="0.9"
    android:visibility="visible"/>

and below this view there is a listview. So when user click on a button this view will pop up but at the same time background view (i.e. ListView) also clickable at the same time.

like image 372
Kunu Avatar asked Mar 16 '15 08:03

Kunu


1 Answers

Set android:clickable="true" in xml to your foreground view.

like image 64
useless dinosaur Avatar answered Oct 20 '22 10:10

useless dinosaur