在Android上放大时,图像会在父视图之外溢出,并在所有其他组件的前面渲染,这与在iOS上仅在父视图内仅渲染图像的放大部分相反。有谁知道如何使Android的行为像iOS?
附上我的代码和两个屏幕截图。
render(){
return(
<PhotoView
source={require('../../Appimages/Map700.png')}
minimumZoomScale={1}
maximumZoomScale={2}
androidScaleType={"fitCenter"}
showsHorizontalScrollIndicator= {false}
showsVerticalScrollIndicator = {false}
onLoad={() => console.log("Image loaded!")}
style={styles.map}
>
</PhotoView>
<View style={styles.mapOverlay}>
<Animated.Image
style={[
styles.pin,
{transform: this.props.valuePinFromParent.getTranslateTransform(),
opacity: this.props.valuePinoFromParent
}]}
source={require('../../Appimages/Parachuter.png')}
/>
<Animated.Image
style={[
styles.battlebus,
{transform: this.props.valueBusFromParent.getTranslateTransform(),
opacity: this.props.valueBusoFromParent}
]}
source={require('../../Appimages/Bus2_0.png')}
/>
</View>
</View>
)
}
Android Zoomed in screenshot--Issue