如何在<Text />
或react-native-maps
中为react-native-map-clustering
设置 fontFamily 。
<Marker coordinate={{ ... }} >
<Text
style={{
fontFamily:"IRANSansMobile"
}}
>
{this.props.pointCount}
</Text>
</Marker>
答案 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>