Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to change image size? #96

Open
mdbaniani opened this issue Nov 23, 2020 · 6 comments
Open

how to change image size? #96

mdbaniani opened this issue Nov 23, 2020 · 6 comments

Comments

@mdbaniani
Copy link

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

@krishnaUIDev
Copy link

krishnaUIDev commented Aug 5, 2021

try imageContainerStyles: {
...styles here
}

@mdbaniani
Copy link
Author

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)

@Ninjaman494
Copy link

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.

@mdbaniani
Copy link
Author

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
Copy link
Author

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
Copy link
Author

this issue somehow addresses this problem:
#73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants