在react-native-maps中为集群文本设置fontFamily

时间:2018-10-03 06:32:19

标签: react-native react-native-android react-native-maps

如何在<Text />react-native-maps中为react-native-map-clustering设置 fontFamily

<Marker coordinate={{ ... }} >
    <Text
        style={{
            fontFamily:"IRANSansMobile"
        }}
    >
        {this.props.pointCount}
    </Text>
</Marker>

1 个答案:

答案 0 :(得分:0)

我使用SVG解决了这个问题 https://github.com/react-native-community/react-native-svg

<Marker
    coordinate={{ ... }}
    onPress={...} 
>
    <Svg
        width={...} height={...}
    >
        <Text
            x={...}
            y={...}
            fontFamily="IRANSansMobile"
            fontSize={20}
            textAnchor="middle"
            fill={"#fff"}
        >
            {this.props.pointCount}
        </Text>
    </Svg>
</Marker>