學(xué)習(xí)知識(shí):
1.?React-navigation之 createStackNavigator
2. Image組件
3.? this.props.navigation.replace
源代碼地址:?https://github.com/ysb002003/ReactNativeLearning_ReactNavigation
具體實(shí)現(xiàn):創(chuàng)建兩個(gè)組件頁面,一個(gè)WelcomePage做為啟動(dòng)頁面放一個(gè)歡迎圖片,一個(gè)IndexPage做為APP首頁或者登錄頁之類
效果圖:


目錄結(jié)構(gòu):

1.?創(chuàng)建項(xiàng)目 react-native init navigation
2.?修改App.js使其通過navigation變成一個(gè)系統(tǒng)的總組件。

3.?創(chuàng)建Images文件夾,放入需要使用的啟動(dòng)圖片
4.?創(chuàng)建theme.js公共文件:

5.?啟動(dòng)頁WelcomePage.js,?使用到Image組件,主要屬性source={require('../images/launch.jpg');? 在render完之后實(shí)現(xiàn)componentDidMount周期函數(shù),進(jìn)行延時(shí)跳轉(zhuǎn) (只要配置了navigator的component都會(huì)自動(dòng)有一個(gè)屬性,this.props.navigation)

6.?首頁
