leecade / leecade/react-native-swiper
how to deal with the onPress event
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.5k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
part of my code is shown as below. Please tell me why the onPress event can not be called.
var image=[];
var carousel=this.state.carousel;
for(var i=0;i<carousel.图片.length;i++){
var path='http://'+config.serverAddress+carousel[i].图片地址;
image.push(
<View>
<TouchableHighlight onPress={()=>{Alert.alert("touch")}}>
<Image source={{uri:path}} height={width/2} navigator={this.props.navigator} key={i}/>
</TouchableHighlight>
</View>
);
}
<Swiper style={styles.wrapper} showsButtons={true} autoplay={true} height={width/2}
activeDot={<View style={{backgroundColor: '#27c081', width: 8, height: 8, borderRadius: 4, marginLeft: 3, marginRight: 3, marginTop: 3, marginBottom: 3,}} />}
nextButton={<Text style={styles.buttonText}>›</Text>}
prevButton={<Text style={styles.buttonText}>‹</Text>}>
{image}
</Swiper>
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the inline render code, focusing on the TouchableHighlight and Swiper interaction. Reproduce the missing onPress callback and inspect the relevant component behavior; done means identifying the cause and documenting or confirming a fix, though the issue names no repository file or test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100