2021年4月4日星期日

Image is causing root ScrollView to resize

For some reason when I add and attempt to style an image it ends up changing the width of the root ScrollView.

<InputScrollView contentContainerStyle={styles.container}>      <View style={styles.profileImageView}>        </View>      <View style={styles.infoContainer}>  
<InputScrollView contentContainerStyle={styles.container}>      <View style={styles.profileImageView}>          <Image style={styles.profileImage} source={require('../../assets/profile.png')} />      </View>  <View style={styles.infoContainer}>  

https://imgur.com/DYORDho

container: {          flex: 1,          width: '100%',          padding: 20,          alignItems: 'center'      },        profileImageView: {          flex: 1,          backgroundColor: 'red',      },        profileImage: {          resizeMode: 'contain'      },        infoContainer: {          flex: 2,          width: '100%',          flexDirection: 'row',      }  

I'm at a loss, nothing I've tried has worked. Am I going about this the wrong way?

https://stackoverflow.com/questions/66947806/image-is-causing-root-scrollview-to-resize April 05, 2021 at 11:07AM

没有评论:

发表评论