Ionic Tab back button not working correctly

in Ionic 2 default i didnt get a back button on tablayouts.then i added tab back button like this

<ion-navbar *navbar danger class="test">
     <ion-title>
        Title
    </ion-title>
</ion-navbar>
<ion-content>
<ion-tabs danger preloadTabs="false">
  <ion-tab class="header" [root]="tab1Root" tabTitle="tab1"></ion-tab>
  <ion-tab class="header" [root]="tab2Root" tabTitle="tab2"></ion-tab>
  <ion-tab class="header" [root]="tab3Root" tabTitle="tab3"></ion-tab>
</ion-tabs>
</ion-content>

the i was able to get back nav button on tabs.but when i open new view from tab( eg. in tab1 button click i open new view (view1)) then the tool bar i added in tab view not replace.it stay.Titiel on the view1 not showing on view1 view.only showing title i use in tab view.how can i fixe this?

@kosalam2 - it looks like that tabs are designed to be for root views exclusively but not for pushed.

I’ve played a bit with that and hit the wall after some time.

As alternative I’m switching to segments:

http://ionicframework.com/docs/v2/components/#segment

2 Likes

Hi,
Did you push the Tabs component like following. Because back button work for me perfectly

itemTapped(event, item) {
this.navCtrl.push(TabsPage, { item: item });
}

What I did is I used basic side nav template in ionic 2 and try to load tabs view when item is select from a list.

How to achieve back functionality in segments?
Please share the solution.
Thanks.