728x90
gif 파일을 표시해보자.
- iOS
따로 할거 없음!
대신, gif를 적용했을 때 조금 느리게 렌더링될 수 있으므로, fast image 라이브러리를 이용하는게 좋다.
github.com/DylanVann/react-native-fast-image
DylanVann/react-native-fast-image
🚩 FastImage, performant React Native image component. - DylanVann/react-native-fast-image
github.com
- Android
android/app/build.gradle - dependencies에 추가
implementation 'com.facebook.fresco:fresco:1.+'
implementation 'com.facebook.fresco:animated-gif:1.+'
- Usage
<Image
source={require('./motion.gif')} // first way (local)
// source={{uri: 'http://www.clicktorelease.com/code/gif/1.gif'}} // second way (http)
width={200}
height={200}
/>
[출처]
react-native — React 네이티브에서 애니메이션 GIF를 표시하려면 어떻게합니까?
기본적으로 Gif 이미지는 Android 네이티브 앱 반응)에서 지원되지 않습니다. GIF 이미지를 표시하려면 Fresco 를 사용하도록 설정해야합니다. Android/app/build.gradle 파일을 작성하고 다음 코드를 추가하십시오. dependencies: { ... compile 'com.facebook.fresco:fresco:1.+' // For animated GIF support compile 'com.facebook.fresco:ani
www.it-swarm.dev
'Solve Problem > React Native' 카테고리의 다른 글
[React Native] GraphQL & Apollo & Code Generator 사용법 (0) | 2020.05.11 |
---|---|
[React Native] WebView 사용법 (0) | 2020.05.11 |
Parent View의 Height를 알고싶다면? (0) | 2020.05.04 |
[React Native] library not found for -lAppAuth / Build input file cannot be found:에러 (0) | 2020.05.04 |
[React Native] react-redux hooks (0) | 2020.05.01 |