• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps layout covering another layout

jessPHP

Newbie
Hi everyone!


I want a layout with alpha=0.5 to cover another layout with a button. I got this. However I am still able to click the button of the covered layout, although the other layout is in the front.

Why??

This is the xml layout:


Code:
 [FONT=Monospace][SIZE=2][COLOR=#008080]<[/COLOR][COLOR=#3f7f7f]RelativeLayout[/COLOR][COLOR=#7f007f]xmlns:android[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"http://schemas.android.com/apk/res/android"[/I][/COLOR][/SIZE][/FONT]
     [FONT=Monospace][SIZE=2][COLOR=#7f007f]xmlns:tools[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"http://schemas.android.com/tools"[/I][/COLOR][/SIZE][/FONT]
     [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:layout_width[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"fill_parent"[/I][/COLOR][/SIZE][/FONT]
     [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:layout_height[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"fill_parent"[/I][/COLOR][/SIZE][/FONT]
     [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:layout_weight[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"6"[/I][/COLOR] [COLOR=#008080]>[/COLOR][/SIZE][/FONT]
 

 [FONT=Monospace][SIZE=2][COLOR=#008080]<[/COLOR][COLOR=#3f7f7f]RelativeLayout[/COLOR][/SIZE][/FONT]
         [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:layout_width[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"match_parent"[/I][/COLOR][/SIZE][/FONT]
         [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:layout_height[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"match_parent"[/I][/COLOR][/SIZE][/FONT]
         [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:layout_alignParentLeft[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"true"[/I][/COLOR][/SIZE][/FONT]
         [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:layout_alignParentTop[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"true"[/I][/COLOR] [COLOR=#008080]>[/COLOR][/SIZE][/FONT]
 

 [FONT=Monospace][SIZE=2][COLOR=#008080]<[/COLOR][COLOR=#3f7f7f]Button[/COLOR][/SIZE][/FONT]
             [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:layout_width[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"wrap_content"[/I][/COLOR][/SIZE][/FONT]
             [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:layout_height[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"wrap_content"[/I][/COLOR][/SIZE][/FONT]
             [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:onClick[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"search_main"[/I][/COLOR][/SIZE][/FONT]
             [FONT=Monospace][SIZE=2][COLOR=#7f007f][U]android:text[/U][/COLOR][COLOR=#3c3c3c][U]=[/U][/COLOR][COLOR=#2a00ff][I][U]"search"[/U][/I][/COLOR] [COLOR=#008080]/>[/COLOR][COLOR=#3f5fbf]<!-- I can click this button -->[/COLOR][/SIZE][/FONT]
 [FONT=Monospace][SIZE=2][COLOR=#008080]</[/COLOR][COLOR=#3f7f7f]RelativeLayout[/COLOR][COLOR=#008080]>[/COLOR][/SIZE][/FONT]
 

 [FONT=Monospace][SIZE=2][COLOR=#008080]<[/COLOR][COLOR=#3f7f7f]RelativeLayout[/COLOR][/SIZE][/FONT]
         [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:id[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"@+id/layoutLoader"[/I][/COLOR][/SIZE][/FONT]
         [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:layout_width[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"match_parent"[/I][/COLOR][/SIZE][/FONT]
         [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:layout_height[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"match_parent"[/I][/COLOR][/SIZE][/FONT]
         [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:layout_alignParentLeft[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"true"[/I][/COLOR][/SIZE][/FONT]
         [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:layout_alignParentTop[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"true"[/I][/COLOR][/SIZE][/FONT]
         [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:alpha[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"0.6"[/I][/COLOR][/SIZE][/FONT]
         [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:background[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"#000000"[/I][/COLOR] [COLOR=#008080]>[/COLOR][/SIZE][/FONT]
 

 [FONT=Monospace][SIZE=2][COLOR=#008080]<[/COLOR][COLOR=#3f7f7f]ProgressBar[/COLOR][/SIZE][/FONT]
             [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:id[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"@+id/progressBarBusqueda"[/I][/COLOR][/SIZE][/FONT]
             [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:layout_width[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"wrap_content"[/I][/COLOR][/SIZE][/FONT]
             [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:layout_height[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"wrap_content"[/I][/COLOR][/SIZE][/FONT]
             [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:layout_centerInParent[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"true"[/I][/COLOR][/SIZE][/FONT]
             [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:layout_marginBottom[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"10dp"[/I][/COLOR][/SIZE][/FONT]
             [FONT=Monospace][SIZE=2][COLOR=#7f007f]android:layout_marginTop[/COLOR][COLOR=#3c3c3c]=[/COLOR][COLOR=#2a00ff][I]"10dp"[/I][/COLOR] [COLOR=#008080]>[/COLOR][/SIZE][/FONT]
 [FONT=Monospace][SIZE=2][COLOR=#008080]</[/COLOR][COLOR=#3f7f7f]ProgressBar[/COLOR][COLOR=#008080]>[/COLOR][/SIZE][/FONT]
 [FONT=Monospace][SIZE=2][COLOR=#008080]</[/COLOR][COLOR=#3f7f7f]RelativeLayout[/COLOR][COLOR=#008080]>[/COLOR][/SIZE][/FONT]
 

 [COLOR=#008080][FONT=Monospace][SIZE=2]</[/SIZE][/FONT][/COLOR][COLOR=#3f7f7f][FONT=Monospace][SIZE=2]RelativeLayout[/SIZE][/FONT][/COLOR][COLOR=#008080][FONT=Monospace][SIZE=2]>[/SIZE][/FONT][/COLOR]
thank you very much!!
 
Hi alostpacket! found the solution! If I implement onClick in that layout it works!! Although it is a very grotty solution.....

Thank you very much!
 
try this:
<RelativeLayout
android:id="@+id/layoutLoader"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:alpha="0.5"
android:background="#000000"
android:clickable="true"
>
 
Back
Top Bottom