react-native-pulse icon indicating copy to clipboard operation
react-native-pulse copied to clipboard

unable to load image url

Open raymclee opened this issue 8 years ago • 7 comments

Hi there, is this support to load image from url with below code?

<Pulse color="orange" numPulses={3} diameter={400} speed={20} duration={2000} image={{ source: { uri: "http://www.freeiconspng.com/uploads/calendar-date-event-month-icon--19.png" } }} />

raymclee avatar Aug 31 '17 04:08 raymclee

I have a similar requirement. is it supported? If yes, Please share some example.

gauravasrivastava avatar Jun 22 '18 23:06 gauravasrivastava

@gauravasrivastava sure you can. Just look at https://github.com/sahlhoff/react-native-pulse/blob/d55a784bc61f2325cea09b6c34c1696158e20460/pulse.js#L169 and follow official RN guide for Image component

glebcha avatar Jun 27 '18 10:06 glebcha

Same issue,

did I miss something with image={source={require('../picture/logo.png')}} ?

Xifeat avatar Oct 19 '18 08:10 Xifeat

@cheuk3 @Xifeat Try specifying the image's style prop with width and height properties set:

<Pulse
  color="orange"
  numPulses={3}
  diameter={400}
  speed={20}
  duration={2000}
  image={{
    source: { uri: "http://www.freeiconspng.com/uploads/calendar-date-event-month-icon--19.png" }
    style: { width: 50, height: 50 }
  }} />

kodie avatar Nov 21 '18 16:11 kodie

also image is not centred on pulse, update style for following view and add {alignItems: 'center', justifyContent: 'center'} to centre image on pulse <View style={[pulseWrapperStyle, {alignItems: 'center', justifyContent: 'center'}]}>

waris117 avatar Jan 30 '19 22:01 waris117

Can you please provide a sample code how to use image in the center of Pulse.

sandipchandra17 avatar Jul 11 '20 09:07 sandipchandra17

also image is not centred on pulse, update style for following view and add {alignItems: 'center', justifyContent: 'center'} to centre image on pulse <View style={[pulseWrapperStyle, {alignItems: 'center', justifyContent: 'center'}]}>

Yo man thanks. :)

eramudeep avatar Nov 26 '20 12:11 eramudeep