美文网首页
谷歌地图的MapView.Circle在ios无法显示

谷歌地图的MapView.Circle在ios无法显示

作者: 幻影形風 | 来源:发表于2019-07-22 17:56 被阅读0次

    问题描述:
    mapview的circle组件在安卓上面可以正常显示,ios出不来,原先代码如下:
    <MapView.Circle
    ref={c => {
    }}
    center={location}
    radius={range || 0}
    fillColor={color}
    strokeWidth={0}
    />
    经过调试验证,在ios下面的fillColor方法,大概率事件没有被调用,预计是RN的js层刷新出了问题。
    解决:
    改为navitve方法调用,直接渲染。代码如下:
    <MapView.Circle
    ref={c => {
    if (c) {
    c.setNativeProps({
    fillColor: color,
    radius: range || 0,
    strokeWidth: 0
    })
    }
    }}
    center={location}
    />

    相关文章

      网友评论

          本文标题:谷歌地图的MapView.Circle在ios无法显示

          本文链接:https://www.haomeiwen.com/subject/kktglctx.html