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

react-native-gesture-handler not working on ios

$
0
0

I have yarn installed react-native-gesture-handler,I then cd'd into ios and pod installed. I then reran the react-native run-ios and still when I swipe nothing happens whatsoever. Im getting zero errors it just doesn't swipe whatsoever. Am i doing something wrong? I have tried to remedy this situation anyway possible and It just doesn't seem to swipe no matter what.

my code is as follows:

import React, {useState} from 'react';import {  Platform,  View,  Text,  StyleSheet,  Image,  TouchableOpacity,  flatList,} from 'react-native';import Swipeable from 'react-native-gesture-handler/Swipeable';const styles = StyleSheet.create({  container: {    padding: 20,    flexDirection: 'row',    backgroundColor: '#fff',    justifyContent: 'space-between',    alignItems: 'center',  },  text: {    fontSize: 18,    color: '#69696969',  },  icon: {    height: 30,    tintColor: '#69696969',    ...Platform.select({      ios: {        tintColor: 'blue',      },      android: {        tintColor: 'red',      },    }),  },  separator: {    flex: 1,    height: 1,    backgroundColor: 'rgba(0, 0, 0, 0.2)',  },});export const Separator = () => <View style={styles.separator} />;const LeftAction = () => {<View><Text>test</Text></View>;};const ListItem = ({name, onFavoritePress}) => {  const [isFavorite, setIsFavorite] = useState(false);  let starIcon;  if (isFavorite) {    starIcon = Platform.select({      ios: require('../assets/icons/ios-star.png'),      android: require('../assets/icons/md-star.png'),    });  } else {    starIcon = Platform.select({      ios: require('../assets/icons/ios-star-outline.png'),      android: require('../assets/icons/md-star-outline.png'),    });  }  return (<Swipeable renderLeftActions={LeftAction}><View style={styles.container}><Text style={styles.text}>{name}</Text>        {onFavoritePress && (<TouchableOpacity            onPress={() => setIsFavorite((prevIsFavorite) => !prevIsFavorite)}><Image style={styles.icon} resizeMode="contain" source={starIcon} /></TouchableOpacity>        )}</View></Swipeable>  );};export default ListItem;

Viewing all articles
Browse latest Browse all 16750

Trending Articles



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