Skip to content Skip to sidebar Skip to footer

Lottie Animation Not Showing At All

My import: implementation 'com.airbnb.android:lottie:3.2.2' In my splash_layout:
const animationRef = useRef<LottieView | null>(); // The <> is for TypeScript, but can be removed for JavaScriptuseEffect(() => {
    animationRef.current?.play();
  }, []);

  return (
    <LottieViewref={(animation) => {
        animationRef.current = animation;
      }}
      source={require("../path_to_animation_folder)}
      autoPlay
      loop
      style={{ width, height }}
    />
  );

Hope I managed to help someone!

Solution 3:

managed to get it working by this:

if(lottieTest.getFrame() == lottieTest.getMaxFrame()) {
   lottieTest.setFrame(1);
}

please refer to this.

Post a Comment for "Lottie Animation Not Showing At All"