How to create transparent over another view in Android?

I want to create a transparent view of my activities. Activity is displayed by clicking a tab. What I want is when I click on any image in my activity, then the transparent view overlays the activity, but my tabs remain clickable. Also, when a transparent view is created, background activity elements should not be clickable. Is it possible? And how will this be achieved in android?

+4
source share
2 answers
//test.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/ic_launcher" android:orientation="vertical" > <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@android:color/transparent" android:orientation="vertical" > </LinearLayout> </LinearLayout> 
+2
source

This allows the overlay image to go through clicks on any buttons below it:

 <ImageView ... android:clickable="false" ... /> 

(And when its value is true , ImageView accepts all clicks)

0
source

Source: https://habr.com/ru/post/1401575/


All Articles