【问题标题】:How to draw a circle in React VR?如何在 React VR 中画一个圆圈?
【发布时间】:2018-04-18 13:30:16
【问题描述】:

我试过了,但得到一个错误“TypeError: this._viewCreator[type] is not a function”。

我不应该从 React Native 导入还是使用其他库?

import {ART} from 'react-native'

const {
  Shape,
  Path,
} = ART

class Circle extends React.Component {
  render() {
    const {radius, ...rest} = this.props

    const circle = Path()
      .move(radius, 0)
      .arc(0, radius * 2, radius)
      .arc(0, radius * -2, radius)

    return <Shape {...rest} d={circle} />
  }

...

<Circle radius={10} fill={blue} />

谢谢!

【问题讨论】:

    标签: react-360


    【解决方案1】:

    您可以使用 Cylinder 和 0 dimHeight

     <Cylinder
       radiusTop={1}
       dimHeight={0}
       segments={32}
     />
    

    【讨论】:

      猜你喜欢
      • 2012-11-12
      • 1970-01-01
      • 2014-06-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多