![](/img/trans.png)
[英]Some custom markers do not appear on Android react-native-maps
[英]custom callout image not rendering in android api level 26 react-native-maps?
我正在使用 react-native-maps 0.23.0 版本。 我在 API 级别 26 及更高级别的 android 中的自定义标注中面临图像渲染问题。 它在 API 23 中工作,但根据谷歌新政策目标 API 级别至少为 26 才能在 Play 商店中提交应用程序,这就是我不能使用 API 级别 23 的原因。
<MapView.Callout tooltip={true} >
{this.state.isMarkerCallout === true && <View style= {{width:Dimensions.get('window').width-40,height:110,backgroundColor:WHITE_COLOR,borderRadius:20,borderColor:BLACK_COLOR,borderWidth:1,alignItems:'center',marginLeft:20,flexDirection:'column'}}>
<View style={{flexDirection:'row',backgroundColor:'white',height:80,marginTop:0,borderRadius:20}}>
<View style={{backgroundColor:WHITE_COLOR,width:Dimensions.get('window').width/2-20,borderRadius:20}}>
<Text style={{marginLeft:15,lineHeight:12,textAlign:'left',fontSize:12,fontFamily:FONT_FAMILY,fontWeight:'bold',marginTop:10}}> <Text>{marker.title}</Text></Text>
</View>
<View style={{backgroundColor:'white',width:Dimensions.get('window').width/2-22,borderRadius:20}}>
<TouchableOpacity style={{backgroundColor:'white',alignItems:'center',marginTop:10}}>
{marker.type === "fixcar"?
<TouchableOpacity onPress={this.openCarWebsite}><Image source={require('../images/WCC.png') } style = {{ width: 112, height: 25,borderRadius:3, resizeMode: "cover", zIndex: 10}}/></TouchableOpacity>
:
<TouchableOpacity style={{backgroundColor:LIGHTGRAY_COLOR}} onPress={this.openWebsite}><Image source={require('../images/spin.png')} style = {{ width: 112, height: 56,borderRadius:3}}/></TouchableOpacity>
}
<Text style={{lineHeight:15,marginLeft:10,textAlign:'center',fontSize:10,fontFamily:FONT_FAMILY,marginTop:10}}> Please visit our website{"\n"}for more details.</Text>
</TouchableOpacity>
</View>
</View>
<View style={{width:30,height:30,alignItems:'center',marginTop:1}}>
<TouchableOpacity onPress={this.showNearLocationPopup}>
<Image source={require('../images/Arrow-Up-icon.png')} style = {{ width: 30, height: 30}}/>
</TouchableOpacity>
</View>
</View>
}
</MapView.Callout>
图像未显示在 android 中的标注中,但在 iOS 中工作正常。
如果在 Text 组件中使用 Image Component 将呈现图像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.