在父视图之外缩放Android溢出

时间:2019-01-25 08:07:59

标签: android android-layout react-native react-native-android zooming

在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

iOS Zoomed in screenshot--functioning properly

Android Not zoomed in--looks fine prior to zooming

0 个答案:

没有答案