參照dribbble app 學習的react native demo
參照dribbble app 學習的react native demo 原app:https://github.com/catalinmiron/react-native-dribbble-app
在學習的過程中遇到了一些異常,其中有些是因為react-native-dribbble-app中使用的一些組件的方法過時(fb更新快且文檔跟不上)。 有幾個問題解決了,還有幾個沒有解決。
install
npm install
進入react-native-dribbble-app/ios 目錄打開 resembleDribbble.xcodeproj
command + r
如果遇到Command /bin/sh failed with exit code 127 錯誤
Go into XCode and go to the Build Phases tab. Remove the last item on the list (the one that runs the script),進入Build Phases,刪除 最后一個列表
Android
安卓我還在摸索,沒有參考,學習有點困難。
安卓中我使用了react-native-tabbar,不太理想。
Plugins used:
react-native-icons 原為:React native vector icons 兩者使用方式有不同
如果遇到'Warning: Native component for "FAKIconImage" does not exist' 說明react-native-icons 沒有安裝,請按react-native-icons的說明把字體導入xcode https://github.com/corymsmith/react-native-icons
{Icon, } = require('react-native-icons')
<Icon name='fontawesome|heart' size={24} color='#333' style={styles.icon} //需要一個樣式設置width height />
react-native-parallax-view
//這是一個拖拽時圖片放大的效果插件,原js中有bug,Dimensions模塊react 已經內置,不需要require. 我改動了原文件,注入Dimensions。 請手動進入/node_modules/react-native-parallax-view/lib/ParallaxView.js 注入Dimensions
var { StyleSheet, View, ScrollView, Animated, Dimensions, } = React; // var screen = require('Dimensions').get('window'); var screen= Dimensions.get('window');
react-native-htmlview