【发布时间】:2018-11-06 16:20:11
【问题描述】:
我正在创建一个 Android 应用程序。
当我点击一个菜单项时,我需要打开一个活动/视图/片段(我不知道什么是最好的)。此活动/片段/视图需要放置为我的应用程序的“覆盖”(它将具有透明背景,我们可以看到后面的“常规”活动)。
我在我的应用程序中使用了一个导航抽屉和几个片段。
首先我尝试了这个:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".AlertActivity"
android:id="@+id/alertLayoutRoot"
android:background="@android:color/transparent"
>
<TextView
android:layout_width="match_parent"
android:id="@+id/editText1"
android:text="@string/mes_favoris"
android:layout_height="match_parent"
>
</TextView>
</FrameLayout>
这确实显示了我的片段,但这个片段并不在所有其他片段之上。
最好的方法是什么(与 Kotlin 合作)?
编辑:忘了说,在这个视图中,会有一个小滑块。
基本上我想要这个:Overlay
【问题讨论】:
标签: android kotlin overlay android-framelayout