I want to create a layout containing only a button, i want the layout to be transparent more even more, i want it 'not to be there', in other words, i want my layout to be only a not full size 'window' but only the button size, so i will be able to continue using any app open behind my app.
我想创建一个只包含一个按钮的布局,我希望布局更加透明,我希望它“不要在那里”,换句话说,我希望我的布局只是一个不完整尺寸的“窗口”但只有按钮大小,所以我将能够继续使用我的应用程序后面打开的任何应用程序。
i tried :
我试过了 :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:windowBackground="@android:color/transparent"
android:windowIsTranslucent="true" >
<ToggleButton android:id="@+id/lockButton"
style="@style/lockToggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true">
</ToggleButton>
The background is really transparent but still a layer and the app in the back is not usable.
背景非常透明,但仍然是一个图层,后面的应用程序不可用。
1 个解决方案
#1
1
As u need to operate other apps , surely u need a service
由于你需要操作其他应用程序,你当然需要一项服务
Try to check about
试着检查一下
Creating a system overlay window (always on top)
创建系统覆盖窗口(始终在顶部)
#1
1
As u need to operate other apps , surely u need a service
由于你需要操作其他应用程序,你当然需要一项服务
Try to check about
试着检查一下
Creating a system overlay window (always on top)
创建系统覆盖窗口(始终在顶部)