如何删除TWA中的底部导航栏?

时间:2019-06-09 17:01:26

标签: progressive-web-apps trusted-web-activity

我已经按照https://developers.google.com/web/updates/2019/02/using-twa

中的说明建立了TWA

我要删除底部的导航栏。我已经读到,只能使用IMMERSIVE模式进行编程:https://developer.android.com/training/system-ui/immersive.html

所以我需要添加与活动“ android.support.customtabs.trusted.LauncherActivity”关联的类,并在onCreate()中添加hideSystemUI()代码。

该怎么做?

这是清单:

....
<activity
    android:name="android.support.customtabs.trusted.LauncherActivity"
    android:theme="@style/Theme.LauncherActivity"
    android:label="@string/app_name">
....

如何为此活动编写沉浸式模式?

1 个答案:

答案 0 :(得分:0)

使用气泡膜

在使用 Bubblewrap(推荐)时,系统会询问您应用程序应使用哪种显示模式作为 init 命令的一部分。

如果您已经初始化了应用程序,请修改twa-manifest.json,将display设置为fullscreen

在 AndroidManifest.xml 中

在自己构建应用程序并使用默认 LauncherActivity 时,您可以将以下元标记设置为 AndroidManifest.xml 中的活动定义的一部分:

 <meta-data android:name="android.support.customtabs.trusted.DISPLAY_MODE"
                android:value="immersive" />