react-native-onboarding-swiper icon indicating copy to clipboard operation
react-native-onboarding-swiper copied to clipboard

how to change image size?

Open mdbaniani opened this issue 4 years ago • 6 comments

I've tried to change the image size by tweaking containerStyles and imageContainerStyles props with no hope. is there any way to increase the size of images to desired amount so that it can also be responsive on different devices? I also tried @2x , @3x implementation of images with no luck.

Screenshot_1606144763

mdbaniani avatar Nov 23 '20 15:11 mdbaniani

try imageContainerStyles: { ...styles here }

krishnaUIDev avatar Aug 05 '21 04:08 krishnaUIDev

try imageContainerStyles: { ...styles here }

as far as I remember I tried everything. I think the mentioned style only styles the image container (as mentioned) and the image inside the container remains untouched (i think no such style as width=100% is carried by the image itself, or can be passed to it)

mdbaniani avatar Aug 05 '21 06:08 mdbaniani

I know this is pretty old, but I was able to set the image size like this:

image: (
  <Image
    source={require("./assets/icon.png")}
    resizeMode="contain"
    style={{ width: 300, height: 300 }}
  />
),

I set the width and height using the <Image/> component's style prop.

Ninjaman494 avatar Dec 20 '21 17:12 Ninjaman494

I know this is pretty old, but I was able to set the image size like this:

image: (
  <Image
    source={require("./assets/icon.png")}
    resizeMode="contain"
    style={{ width: 300, height: 300 }}
  />
),

I set the width and height using the <Image/> component's style prop.

thx i will try in my app's next update

mdbaniani avatar Dec 23 '21 15:12 mdbaniani

I know this is pretty old, but I was able to set the image size like this:

image: (
  <Image
    source={require("./assets/icon.png")}
    resizeMode="contain"
    style={{ width: 300, height: 300 }}
  />
),

I set the width and height using the <Image/> component's style prop.

you used fixed width and height here but if you pass {height : '100%'} to the image you will realize that the image will not fully reach the height of image container

mdbaniani avatar Jan 10 '22 04:01 mdbaniani

this issue somehow addresses this problem: https://github.com/jfilter/react-native-onboarding-swiper/issues/73

mdbaniani avatar Jan 10 '22 04:01 mdbaniani