2

I have build a TWA as described at https://developers.google.com/web/updates/2019/02/using-twa

I want to remove the bottom navigation bar. I have read that it can only be done programmatically with IMMERSIVE mode : https://developer.android.com/training/system-ui/immersive.html

So i need to add a Class associated to the activity "android.support.customtabs.trusted.LauncherActivity" and to add the hideSystemUI() code in onCreate() i guess.

How to do that ?

Here is the manifest :

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

How to code the immersive mode for this activity ?

4

1 回答 1

0

使用气泡膜

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

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

在 AndroidManifest.xml 中

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

 <meta-data android:name="android.support.customtabs.trusted.DISPLAY_MODE"
                android:value="immersive" />
于 2021-02-23T08:42:37.340 回答