react-native-image-sequence
react-native-image-sequence copied to clipboard
Set resizeMode / size for the images
Is that possible to set a resizeMode like Image component?
I have a size defined via style for my ImageSequence component, but on Android the images are being resized according the image and not according my style of parent component. If I add a background color to the ImageSequence, I can see its size is correct. I would like to define how the image is handled there, currently it is like "contain" but I would like something like "cover".
Any suggestion?
Hey, Please is this a thing?
I create a patch for fixing this issue on android.
Create a new file (react-native-image-sequence+0.7.0.patch) inside patches folder and paste the below code -
diff --git a/node_modules/react-native-image-sequence/android/src/main/java/dk/madslee/imageSequence/RCTImageSequenceView.java b/node_modules/react-native-image-sequence/android/src/main/java/dk/madslee/imageSequence/RCTImageSequenceView.java
index a072809..da8a906 100644
--- a/node_modules/react-native-image-sequence/android/src/main/java/dk/madslee/imageSequence/RCTImageSequenceView.java
+++ b/node_modules/react-native-image-sequence/android/src/main/java/dk/madslee/imageSequence/RCTImageSequenceView.java
@@ -91,6 +91,8 @@ public class RCTImageSequenceView extends ImageView {
}
public void setImages(ArrayList<String> uris) {
+ this.setScaleType(ScaleType.FIT_XY);
+
if (isLoading()) {
// cancel ongoing tasks (if still loading previous images)
for (int index = 0; index < activeTasks.size(); index++) {