【问题标题】:How to remove the bottom navigation bar in a TWA?如何删除 TWA 中的底部导航栏?
【发布时间】:2019-06-09 17:01:26
【问题描述】:

我已经按照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">
....

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

【问题讨论】:

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


【解决方案1】:

使用气泡包装

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

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

在 AndroidManifest.xml 中

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-10-28
    • 2021-05-03
    • 2020-11-16
    • 2017-01-29
    • 1970-01-01
    • 2014-05-24
    • 2018-08-19
    • 1970-01-01
    相关资源
    最近更新 更多