react native mapbox MarkView只显示一个子组件问题

解决方案:
用<View style={{backgroundColor:'transparent',width:55}}>包裹子组件

  <MapboxGL.MarkerView
        anchor={{ x: 0.5, y: 1 }}
        coordinate={
          this.props.currentPoint != null
            ? this.props.currentPoint.geometry.coordinates
            : this.props.route.geometry.coordinates[0]
        }>
        <View style={{backgroundColor:'transparent',width:55}}>
          <ImageBackground
            style={{ width: 55, height: 68, justifyContent: 'flex-start' }}
            source={require('../../../../imgs/map/c-5water.png')}>
          <Image
              style={{
                width: 55,
                height: 55,
                borderRadius: 30,
                alignSelf: 'center',
              }}
              source={{ uri: global.currentUser.WxHeadImg }}
            />  
          </ImageBackground>
          
        </View>

      </MapboxGL.MarkerView>
posted @ 2020-12-15 11:15  木子归零  阅读(123)  评论(0编辑  收藏  举报