Comments (5)
Can, Very good components, thanks!
from react-native-responsive-image-view.
Hi @showtan001.
I'm not sure I understand the issue. Can you provide some example code reproducing the problem, possibly in a Snack?
Thank you.
from react-native-responsive-image-view.
const MyTouchableComponent = ({ imageUri, onPress, contentStyle, content }) => ( <ResponsiveImageView source={{ uri: imageUri }} render={({ getViewProps, getImageProps }) => ( <View {...getViewProps() }> <TouchableOpacity onPress={onPress}> <Image {...getImageProps() } /> <Text style={contentStyle}>{content}</Text> </TouchableOpacity> </View> )} /> );
let dataArr = ["https://s.chydof.com/yc/20180210/bb72081c659fd8f91a0c3f97f7cd3618.jpg", "https://s.chydof.com/yc/20180210/e1f905774c9558c9b1b6644f9ee2c61a.jpg", "https://s.chydof.com/yc/20180210/914219e222287b92276de0b2b3867c56.jpg"]; render() { return ( <ScrollView style={containers}> { dataArr.map((item, index) => ( <MyTouchableComponent contentStyle={{ color: '#000' }} content={index} imageUri={item} onPress={() => { }} /> )) } </ScrollView> ) }
Add Text to make a mistake or not to show. Can you add Text? Thank you!
from react-native-responsive-image-view.
Will this work for you?
const MyTouchableComponent = ({ imageUri, onPress, contentStyle, content }) => (
<TouchableOpacity onPress={onPress}>
<ResponsiveImageView
source={{ uri: imageUri }}
render={({ getViewProps, getImageProps }) => (
<View {...getViewProps()}>
<Image {...getImageProps()} />
</View>
)}
/>
<Text style={contentStyle}>{content}</Text>
</TouchableOpacity>
);
from react-native-responsive-image-view.
Great! Thank you.
from react-native-responsive-image-view.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-responsive-image-view.