Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

TouchableOpacity onPress doesn't work inside ScrollView

$
0
0

(iOS Only)<TouchableOpacity> doesn't respond if it is inside of a <ScrollView> :

  1. It works properly in the simulator but not in a real device,
  2. keyboardShouldPersistTaps="always" doesn't make any difference
  3. Partial code:<ScrollView style={styles.scrollView}><TouchableOpacity style={styles.xButton} onPress={() => this._onClose()}>

any suggestions?

--- Code update -----

<ScrollView style={styles.scrollView}><TouchableOpacity style={styles.xButton} onPress={() => this._onClose()}><Image style = {styles.xImg} source = {require('../../images/xbtn.png')}/></TouchableOpacity>     {this._renderPricing()}     {this._renderServices()}</ScrollView>

and the Styling looks like this:

scrollView:{     width: width,    height: height,}, xButton: {    position: 'absolute',    zIndex: 1,    marginTop: '1%',    marginRight: '3%',    alignSelf: 'flex-end',},xImg: {    resizeMode: 'contain',    aspectRatio: .6,    opacity: 0.5,},

Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>