React-native-swiper: can't use onPress with swiper

Created on 20 Apr 2017  路  4Comments  路  Source: leecade/react-native-swiper

Most helpful comment

@harrisrobin @Evacaca worked for me:

 <View style={styles.slide2}>
          <TouchableWithoutFeedback onPress={() => console.log("onPress")}>
            <Image
              resizeMode="stretch"
              style={styles.image}
              source={require("../images/test2.jpg")}
            />
          </TouchableWithoutFeedback>
        </View>

All 4 comments

@Evacaca this solves the problem:

https://github.com/leecade/react-native-swiper/issues/201

Please close the thread if that works for you :)

@harrisrobin @Evacaca worked for me:

 <View style={styles.slide2}>
          <TouchableWithoutFeedback onPress={() => console.log("onPress")}>
            <Image
              resizeMode="stretch"
              style={styles.image}
              source={require("../images/test2.jpg")}
            />
          </TouchableWithoutFeedback>
        </View>

ios can't onPress

Does not work on iOS

<TouchableWithoutFeedback 
                onPressIn={() => console.log('in')} 
                onPressOut={() => console.log('out')} 
                onPress={() => {
          console.log("clicked");
          setVisible(!visible);
        }}>

            <Swiper
              onIndexChanged={swiperIndexChange}
              key={images ? images.length : 0}
              width={width}
              height={height}
              showsPagination={false}
              loop={false}>
              {images.map((url, index) => {
                return (
                  <View key={index}>
                    <ImageItem imageUrl={url} />
                  </View>
                );
              })}
            </Swiper>
        </TouchableWithoutFeedback>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

JonasOmdal picture JonasOmdal  路  3Comments

kliuj picture kliuj  路  3Comments

chetanparakh picture chetanparakh  路  3Comments

wrannaman picture wrannaman  路  3Comments

commit-master picture commit-master  路  3Comments