react native ios加载webp格式图片

2018-03-14  本文已影响633人  慕诩

react native 中 ios默认是不能加载webp格式图片的,用了一个第三方库

1.npm install react-native-webp --save

2.rnpm link react-native-webp

3.Open your project in xcode

Right click your 找一个文件夹() and select "Add Files to ..."(creat guoup方式)Select "WebP.framework"  from node_modules/react-native-webp/ and click "OK"

Select your Target -> Select "Build Settings"

Add "$(SRCROOT)/../node_modules/react-native-webp" to the "Framework Search Path"

ok

上一篇 下一篇

猜你喜欢

热点阅读