My Android XML-Layout looks like this
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:gravity="center"
android:background="?android:colorBackground"
android:layout_width="match_parent"
android:layout_height="match_parent">
<SomeView
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@android:color/transparent"/>
</LinearLayout>
What I need is a 'See-Through' hole in my Background LinearLayout at the size of my small View. Like in the following Picture:
Is this possible? How?
use transparent background in views that you want to make transparent so if there is any view behind it it will display
eg:
android:background="#00000000"
If you wish a see-through background for the view, what can be done is :-
Hope that this helps.
Example :
<LinearLayout
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent" android:background="@android:color/holo_red_dark">
<LinearLayout
android:orientation="vertical"
android:gravity="center"
android:background="@android:color/holo_blue_bright"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="30dp">
<View
android:layout_width="40dp"
android:layout_height="40dp"
android:background="@android:color/holo_red_dark"/>
</LinearLayout>
</LinearLayout>
查找Alpha频道-我认为这基本上就是您在这里寻找的内容。
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.