Giter VIP home page Giter VIP logo

Comments (5)

showtan001 avatar showtan001 commented on June 1, 2024 1

Can, Very good components, thanks!

from react-native-responsive-image-view.

wKovacs64 avatar wKovacs64 commented on June 1, 2024

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.

showtan001 avatar showtan001 commented on June 1, 2024

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.

wKovacs64 avatar wKovacs64 commented on June 1, 2024

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.

wKovacs64 avatar wKovacs64 commented on June 1, 2024

Great! Thank you.

from react-native-responsive-image-view.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.