首页 > 解决方案 > show VR tour in android

问题描述

I want to show VR tour like this http://alfavr.ir/alfavr.ir/to/park.html in my Android app. how can I do that? I tried to display with web view because the file format is Html but did not work.

标签: android

解决方案


您可以尝试使用 Google VR SDK 中包含的 VRPanormaView。这是来自https://developers.google.com/vr/develop/android/vrview的示例:

<com.google.vr.sdk.widgets.pano.VrPanoramaView
    android:id="@+id/pano_view"
    android:layout_margin="5dip"
    android:layout_width="match_parent"
    android:scrollbars="@null"
    android:layout_height="250dip" />

在 Activity 内部,主要方法是VrPanoramaView.loadImageFromBitmap(). 使用标准 Android 位图对象和可选VrPanoramaView.Options对象调用它。后者用于配置图像的格式。Activity 还实现了一个VrPanoramaEventListener在加载操作成功或失败时接收事件的方法。


推荐阅读