gpt4 book ai didi

android - Google Play 游戏初始化时如何隐藏 Android 标题栏?

转载 作者:太空狗 更新时间:2023-10-29 14:38:33 26 4
gpt4 key购买 nike

当我初始化 Google Play 游戏时,当我的游戏加载后,“正在连接到 Google Play 游戏”窗口出现在开始时 - Android 标题栏也会暂时出现。一旦 GPG 登录窗口消失,它就会消失。我该如何阻止这种情况发生?在我的游戏 list 中,我在 Activity 标签中设置了以下样式:

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

这显然有效,因为我在游戏运行时看不到工具栏。我查看了 Google Play 游戏服务 GameBaseUtils list ,发现它没有任何 Activity 标签,因此我将 NoTitleBar 样式添加到应用程序标签中,如下所示:

<application
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</application>

但是,当游戏加载和 Google Play 游戏初始化时,标题栏仍然(暂时)显示。有什么办法可以在 GPG 初始化时完全去掉标题栏吗?

最佳答案

在您的 onCreate() 方法中执行此操作。干杯!

//Remove title bar

this.requestWindowFeature(Window.FEATURE_NO_TITLE);

//Remove notification bar
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

//set content view AFTER ABOVE sequence (to avoid crash)
this.setContentView(R.layout.your_layout_name_here);

关于android - Google Play 游戏初始化时如何隐藏 Android 标题栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51920661/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com