问题描述:

In my code after user clicked on a button i want to redirect it to first page (login) page.

i tried to do that with navigator.push , it works but it still shows the top header and tabbarios in bottom.

How can i just reload the app with one button , or force render index.ios? (rerender root page)

I also want to do same with TabBarIOS. whenever you scroll or go deeper in a tab, when you go to another tab and come back to first tab, it's not rerendering. showing the last status of it.

Thanks in Advance!

网友答案:

It's a bit hard seeing without code.

You want to refresh screen, under certain condition ?

If your screen is a component and if you change your component state ( this.setState() ), it will change those state value accordingly in your page.

[UPDATE]

Thanks for clarification :

So, in your index render you can do something like :

render(){

    if(this.state.logout){//Whatever condition you want to be met.
       return (<Login />);
    }
    else{
      return (<TabBarIOS ... />);
    }

}

It should remove the TabBar and show the login.

相关阅读:
Top