0

I am using Grid with a View of fixed height 150 and a Row with the rest of the height In the view i am showing a text input and in the Row i am showing a Webview When i touch the input the keyboard opens and if i press the back button the app crashes

If i remove the webview and do the same the app is not crashing

<Grid>
  <View style={styles.screenView}>
    <ImageBackground
      source={size(course.image_url) > 0 ? { uri: course.image_url } : logo}
      resizeMode="cover"
      style={styles.imageBackground}
    >
      ......
    </ImageBackground>
  </View>
  <View style={styles.screenView}>
    <View style={styles.container}>
      <TextInput
        style={styles.reviewInput}
        onChangeText={addReview.bind(props)}
        placeholder="Your reviews about the course"
        value={review}
        multiline={true}
      />
    </View>
    <LoadingButton
      isLoading={isLoading}
      isFormDirty={size(review) > 0 ? false : true}
      loadingText="Saving"
      text="Save Review"
      block={true}
      color={Color.primaryText}
      loaderColor="#FFFFFF"
      textColor={styles.lightText}
      style={styles.reviewButton}
      onPress={saveReview.bind(props)}
    />
  </View>
  <Row>
    <View style={styles.scroller}>
      <WebView originWhitelist={['*']} source={{ html: courseDescription }} />
    </View>
  </Row>
</Grid>

Styles for webview:

scroller: {
    flex: 1,
    overflow: 'hidden',
  },

enter image description here

Nidhin Kumar
  • 3,278
  • 9
  • 40
  • 72

1 Answers1

0

There is only one Row area in your code. It means the whole thing. You should mark the area separately.

<Grid>
    <Row size={9}>
     <View> 
       ...
    </Row>
    <Row size={1}>
     <View style={styles.scroller}>
      <WebView originWhitelist={['*']} source={{ html: courseDescription }} />
    </View>
    </Row>
</Grid>
hong developer
  • 13,291
  • 4
  • 38
  • 68