閱讀418 返回首頁    go 阿裏雲 go 技術社區[雲棲]


react native插件 react-navigation使用心得

StackNavigator

StackNavigator(screens,configs)
const Stack = StackNavigator({
  Home: {
    screen: Home,
  },
  Profile: {
    screen: Profile
  }
},{
    mode: 'card',  // 頁麵切換模式, 左右是card(相當於iOS中的push效果), 上下是modal(相當於iOS中的modal效果)
    headerMode: 'screen', // 導航欄的顯示模式, screen: 有漸變透明效果, float: 無透明效果, none: 隱藏導航欄
    onTransitionStart: ()=>{ console.log('導航欄切換開始'); },  // 回調
    onTransitionEnd: ()=>{ console.log('導航欄切換結束'); }  // 回調
});

screen頁麵

export default class Home extends React.Component {
  //本頁麵的屬性配置
  static navigationOptions = {
    title: 'Home',
  }
  render() {
    return (
      <View>
        <Text>Home</Text>
      </View>
    )
  }
}

最後更新:2017-08-29 17:33:02

  上一篇:go  如何搭建一套專業一體化唿叫中心平台-米領通信
  下一篇:go  遊戲安全資訊精選 2017年 第五期:國際網絡犯罪基礎設施被曝光,WireX 僵屍網絡襲擊全球,遊戲行業最大攻擊流量有所下降