0

我已經創建了應用程序,其中我有3個選項卡以使用React Native顯示網頁。每當我切換到標籤2從標籤1,然後回到標籤1,webview它仍然工作,而不是重新加載,但是當我切換到標籤3時,標籤1和2重新加載時,當我回到標籤1或標籤2從標籤3中。所以,我認爲它不適用於WebView的3個標籤?如何防止重新加載WebView頁面[Android React Native]

我使用react-native-router-flux來創建一個tabbar。

<Scene key="root" tabs={true}> 
    <Scene key="menus"> 
     <Scene key="tabbar" tabs={true} tabBarStyle={{backgroundColor:'#f7f7f7'}}> 
      <Scene key="Schedule" component={Schedule} title="Schedule" icon={TabIcon} hideNavBar={true}/> 
      <Scene key="Chatbox" component={Chatbox} title="Chatbox" icon={TabIcon} hideNavBar={true}/> 
      <Scene key="Home" component={Home} title="Home" icon={TabIcon} hideNavBar={true}/> 
      <Scene key="Podcast" component={Podcast} title="Podcast" icon={TabIcon} hideNavBar={true}/> 
      <Scene key="About" component={About} title="About" icon={TabIcon} hideNavBar={true}/> 
     </Scene> 
    </Scene> 
</Scene> 

這是從1 3頁的WebView代碼:

var sourceChatbox = {uri: 'URL_HERE'}; 
return(
    <Container> 
     {this.renderHeader()} 

     <Content contentContainerStyle={{flex: 1, margin: 10, marginBottom: 60}}> 
      <WebView source={sourceChatbox}/> 
     </Content> 
    </Container> 
); 

感謝您的幫助。我從來沒有使用

回答

-1

反應本地路由器通量之前,目前越來越多的人正在使用的反應導航更多,也許你應該檢查出

+0

尼斯,它與反應的導航工作。但我不知道爲什麼它總是重新加載RN路由器通量,也許有些人知道如何解決。以前感謝。 – ASHafizullah

相關問題