2016-10-20 35 views
0

我有類似可以左右移出屏幕的卡片, 但它們呈現在導航欄下方,是否有重新排序索引的地方? 我的代碼設置非常標準,所以通過邏輯,酒吧將永遠在頂部 - 我想?想不出反正周圍反應本機導航欄z-index

renderScene(route, nav) { 
    const {globalNav} = nav.props; 
    switch (route.name) { 
     case 'settings' : 
      return <Settings />; 

     case 'feed' : 
      return <Feed />; 

     case 'matches' : 
      return <Matches />; 
    } 
} 

render() { 
    const {globalNav} = this.props; 
    return (
     <Navigator 
      renderScene={this.renderScene} 
      navigationBar={ <Navigator.NavigationBar routeMapper={NavigationBar} />} 
     /> 
    ); 
} 

see screen shot

回答

0

的zIndex的佈局屬性爲我工作!

Layout Props Description

哪些組件他人的頂部顯示zIndex的控件。通常, 您不使用zIndex。組件根據它們在 文檔樹中的順序進行渲染,因此後面的組件會在較早的組件上繪製。 zIndex 可能是有用的,如果你有動畫或自定義模態界面 你不想要這種行爲。

它的工作方式與CSS z-index屬性相同 - 具有較大 zIndex的組件將呈現在最上面。想想Z軸方向,就像它將 從手機指向你的眼球。請參閱 https://developer.mozilla.org/en-US/docs/Web/CSS/z-index瞭解更多 的詳細信息。

+1

似乎不工作?你能分享你的代碼嗎? – kaelidoscope