无法检测到 WebVR 模式 - 将 phone 插入 Cardboard 支架
Cannot detect WebVR mode - Insert phone into Cardboard holder
我正在尝试 运行 aframe "hello world" example on snack.expo。当我尝试进入 VR 模式时(单击右下角的纸板图标)我收到消息 "Insert phone into Cardboard holder".
我找不到绕过消息的方法。由于某种原因,似乎无法检测到 phone 被放置在纸板支架内。我的 phone 上的 "Auto Rotate" 已启用。
当我按下 "X" 图标时,它会返回标准 3D 模式(不是分屏)。
import React, { Component } from 'react';
import { WebView } from 'react-native';
export default class MyWeb extends Component {
render() {
return (
<WebView
source={{uri: 'https://aframe.io/aframe/examples/boilerplate/hello-world'}}
style={{marginTop: 20}}
/>
);
}
}
当前结果:
预期结果:
进一步调查后发现该应用程序被锁定在纵向模式,因此 aframe 无法检测到横向。
作为快速测试,我尝试了以下方法来验证:
import React, { Component } from 'react';
import { WebView } from 'react-native';
export default class MyWeb extends Component {
constructor(props) {
super(props);
Expo.ScreenOrientation.allow(Expo.ScreenOrientation.Orientation.LANDSCAPE)
}
render() {
return (
<WebView
source={{uri: 'https://aframe.io/aframe/examples/boilerplate/hello-world'}}
style={{marginTop: 20}}
/>
);
}
}
我正在尝试 运行 aframe "hello world" example on snack.expo。当我尝试进入 VR 模式时(单击右下角的纸板图标)我收到消息 "Insert phone into Cardboard holder".
我找不到绕过消息的方法。由于某种原因,似乎无法检测到 phone 被放置在纸板支架内。我的 phone 上的 "Auto Rotate" 已启用。
当我按下 "X" 图标时,它会返回标准 3D 模式(不是分屏)。
import React, { Component } from 'react';
import { WebView } from 'react-native';
export default class MyWeb extends Component {
render() {
return (
<WebView
source={{uri: 'https://aframe.io/aframe/examples/boilerplate/hello-world'}}
style={{marginTop: 20}}
/>
);
}
}
当前结果:
预期结果:
进一步调查后发现该应用程序被锁定在纵向模式,因此 aframe 无法检测到横向。
作为快速测试,我尝试了以下方法来验证:
import React, { Component } from 'react';
import { WebView } from 'react-native';
export default class MyWeb extends Component {
constructor(props) {
super(props);
Expo.ScreenOrientation.allow(Expo.ScreenOrientation.Orientation.LANDSCAPE)
}
render() {
return (
<WebView
source={{uri: 'https://aframe.io/aframe/examples/boilerplate/hello-world'}}
style={{marginTop: 20}}
/>
);
}
}