Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Image is not rendering in iOS #464

Open
Yandamuri opened this issue May 5, 2021 · 4 comments
Open

Image is not rendering in iOS #464

Yandamuri opened this issue May 5, 2021 · 4 comments

Comments

@Yandamuri
Copy link

Image is not rendering in iOS. I tried in

iPhone 6(iOS 12.5.2),
iPhone SE(iOS 14.4.2),
Emulator - iPhone 12 Pro

Are there any settings to be enabled specific for iOS?

@iMonk777
Copy link

I've had the same issue on IOS.
I manage to fix it by using the renderImage prop, and render my own image component. @Yandamuri

@Yandamuri
Copy link
Author

@iMonk777 Able to render image , but it's size is very small as shown below,

IMG_0017

And this is how I rendered

  return (
		<View style={{flex: 1}}>
			<ImageViewer 
                                   imageUrls={images}
                                   renderImage={() => <Image style={{height: '100%', width: '100%'}} resizeMode={'contain'} source={{uri:`${axios.defaults.baseURL}${url}`, headers}} />}
                                   enableImageZoom={true}
                                   backgroundColor={TEXT_HEADERBLACK}
                                   maxOverflow={0}
                                   renderIndicator={() => <></>}
                             />
		</View>
);

What changes should I do to make image fit to the screen?

@iMonk777
Copy link

iMonk777 commented May 18, 2021

Tried the same code as yours @Yandamuri , And it works for me. It is probably related to your image resolution? Maybe try a bigger resolution image from google, just for testing.
Also, if you have an array of images, the URL for each image can be taken from the source, like below

 renderImage={({ source }) => (
                            <Image
                                source={source} //here my source is an object {uri: 'my image link'}
                                style={styles.image}
                            />
                        )}

@Yandamuri
Copy link
Author

@iMonk777 I have tried multiple hd images like 750 × 1334 But still result is same. Strange thing is Images are rendering as expected in android. Problem is with iOS only. Tried in both Simulator and real device. But result is same.

Did you try in iOS?

Any guess that why it is not working in iOS?

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

No branches or pull requests

2 participants