Open OFD16 opened 6 months ago
Furthermore, if you're not using FlatList like me, ensure to include an 'id' prop for your image data, just as I did.
(Update: If you need to use more than one ImageProvider on a screen, make sure that the id of the data in each imageProvider is different, otherwise it may give the same error.)
const images = event.medias.map((media, i) => ({
source: media.url,
id: i,
}));
This can fix your
ERROR TypeError: Cannot read property 'toString' of undefined
I'd like to create an image gallery where the last image includes a text overlay indicating the count of remaining images. However, when I position the text using the 'absolute' property, the image becomes unclickable and doesn't expand to full screen. I've attempted to modify the package source code by adding a 'renderItem' or 'lastItem' prop to ensure the last image remains clickable, but it didn't work due to the Image component's limitations. The source code uses an 'onLayout' prop to enable full-screen functionality, but if I use a View or another element to overlay text on the Image, it doesn't inherit these properties, preventing it from going full screen. Do you have any suggestions or ideas on how to achieve this?
As a solution, applying a blur effect to the image allows for placing text directly onto it, achieving the desired layout. However, when text with a background color is added onto the image, it becomes unclickable and fails to expand to full size.
My suggestion for now is to utilize the 'blur' prop to achieve the desired effect.
Source code part:
Thats my solutions:
The solution part is:
This is full code if you want to check: