Navigation 重定向后,标题中的“返回”按钮不显示

Navigation 重定向后,标题中的“返回”按钮不显示,navigation,ionic-framework,Navigation,Ionic Framework,我在应用程序中显示后退按钮时遇到问题 我使用以下命令重定向到新页面: <button class="button button-full button-positive" ui-sref="tab.dash" > Full Width Block Button </button> 全宽块按钮 在第二页的重定向之后,标题中没有显示后退箭头图标 这是index.html中的content body标记 <body ng-ap

我在应用程序中显示后退按钮时遇到问题

我使用以下命令重定向到新页面:

<button class="button button-full button-positive" ui-sref="tab.dash" >
            Full Width Block Button
        </button>

全宽块按钮
在第二页的重定向之后,标题中没有显示后退箭头图标

这是index.html中的content body标记

<body ng-app="starter" animation="slide-left-right-ios7">
    <!-- 
      The nav bar that will be updated as we navigate between views.
    -->
    <ion-nav-bar class="bar-positive nav-title-slide-ios7">
      <ion-nav-back-button class="button-icon icon  ion-ios7-arrow-back">
        Back
      </ion-nav-back-button>
    </ion-nav-bar>
    <!-- 
      The views will be rendered in the <ion-nav-view> directive below
      Templates are in the /templates folder (but you could also
      have templates inline in this html file if you'd like).
    -->
    <ion-nav-view>

    </ion-nav-view>
  </body>
.state('app.single', {
    url: '/playlists/1',
    views: {
      'menuContent': {
        templateUrl: 'templates/playlist.html',
        controller: 'PlaylistCtrl'
      }
    }
  });

返回
im重定向的第二个模板的内容。

<ion-view title="Charts - days">
  <ion-content class="padding">
    <h1>test</h1>
      <div class="row" on-touch="alert('right');">
          <div class="col" on-touch="alert('right');" style="background-color: red;">.col</div>
      </div>
      <button on-touch="alert('touch');" class="button">Test</button>

  </ion-content>
</ion-view>

测试
上校
试验

有人能告诉我我做错了什么吗?

你可以用两种方法来做。。。
  <ion-nav-back-button>
  </ion-nav-back-button>
1-转到App.js文件并添加状态,如--

   .state('app.playlists', {
      url: '/playlists',
      views: {
        'menuContent': {
          templateUrl: 'templates/playlists.html',
          controller: 'PlaylistsCtrl'
        }
      }
    })
现在,如果您想添加新状态并自动显示后退按钮-

<body ng-app="starter" animation="slide-left-right-ios7">
    <!-- 
      The nav bar that will be updated as we navigate between views.
    -->
    <ion-nav-bar class="bar-positive nav-title-slide-ios7">
      <ion-nav-back-button class="button-icon icon  ion-ios7-arrow-back">
        Back
      </ion-nav-back-button>
    </ion-nav-bar>
    <!-- 
      The views will be rendered in the <ion-nav-view> directive below
      Templates are in the /templates folder (but you could also
      have templates inline in this html file if you'd like).
    -->
    <ion-nav-view>

    </ion-nav-view>
  </body>
.state('app.single', {
    url: '/playlists/1',
    views: {
      'menuContent': {
        templateUrl: 'templates/playlist.html',
        controller: 'PlaylistCtrl'
      }
    }
  });
在这种情况下,您不需要只在menu.html中编写返回按钮的代码,检查此按钮是否可用?

  <ion-nav-back-button>
  </ion-nav-back-button>
现在在您的HTML页面中,在ion内容开始后编写此内容

<ion-content>

        <div class="bar bar-header bar-calm">
            <button class="button ion-chevron-left" ng-click="GoBack()"></button>
            <h6 class="title">Security Settings</h6>
        </div>
 </ion-content>

安全设置

您的用户可能正在导航到其他选项卡的视图。每个选项卡都有自己的导航历史堆栈,因此如果导航到新选项卡,将获得新的历史堆栈。您可以在这里看到选项卡工作方式的演示。。。如果要在选项卡之间导航,请选中