我有一个自定义标记图片,想要使用变量来控制图片的透明度。我尝试了以下代码,但出现了错误:"无法将可读本地映射转换为双精度浮点数作为不透明度的值"
var status=1;
<MapView.Marker
key={marker.latitude}
coordinate={{ latitude: marker.latitude, longitude: marker.longitude }}
onPress={() => this.props.Quiz2(marker.latitude, marker.longitude)} >
<View><Image source={require('../assets/icons/quiz.png')} style={{ width: 40, height: 40,opacity:status}}/></View>
</MapView.Marker>
status = 1.0
。 - Juorder GonzalezAnimated.Image
替代Image
了吗? - Mher