如何在 GvrView 中隐藏两个按钮

How to hide two buttons in GvrView

在google的Cardboard API中我们可以使用CardboardView.setSettingsButtonEnabled(boolean)方法隐藏屏幕底部的设置按钮。 现在,Google VR API 分级为 1.0。使用 GvrView 而不是 'CardboardView',并且在左侧|顶部添加关闭按钮时设置按钮移动到顶部|右侧,但我找不到任何可以隐藏这两个按钮的 GvrView 方法。 请帮我解决一下,谢谢

是的,我认为开发人员不打算添加此方法。 [https://github.com/googlevr/gvr-android-sdk/issues/252][1]

在当前版本 (1.170.0) 的 GVR SDK 中。您可以找到按钮并删除它们(但仅适用于 Android 的旧版本):

// Settings Button
val settingsButton = gvrView.findViewById<ImageButton>(R.id.ui_settings_button)
settingsButton.visibility = View.GONE

// Back Button
val backButton = gvrView.findViewById<ImageButton>(R.id.ui_back_button)
backButton.visibility = View.GONE

// Alignment Marker
val alignmentMarker = gvrView.findViewById<RelativeLayout>(R.id.ui_alignment_marker)
alignmentMarker.visibility = View.GONE