javascript - Ionic 1 : make ion-nav-bar fixed, 不在 View 之间更新

标签 javascript mobile ionic-framework hybrid-mobile-app

我正在开发一个非常简单的Ionic 1 应用程序,我想要ion-nav-bar固定,始终相同,显示 Logo 作为每个 View 的标题。

关于 ionNavBar docs该指令的用法应如下所示:

<body ng-app="starter">
  <!-- The nav bar that will be updated as we navigate -->
  <ion-nav-bar class="bar-positive">
  </ion-nav-bar>

  <!-- where the initial view template will be rendered -->
  <ion-nav-view>
    <ion-view>
      <ion-content>Hello!</ion-content>
    </ion-view>
  </ion-nav-view>
</body>

我的应用程序的 index.html <body>看起来很像:

<body ng-app="adidasApp">

  <ion-nav-bar>
    <ion-nav-title>
      <img src="img/my-logo.png">
    </ion-nav-title>
  </ion-nav-bar>

  <ion-nav-view>
  </ion-nav-view>

</body>

正如文档指出的那样

The nav bar that will be updated as we navigate

导航栏将在我们导航时更新。这使我的图像变淡,每次在 View 之间切换时感觉它正在加载。

但我不希望这种情况发生。我希望我的图像始终保持静止,而不是每次更改 View 时都更新。有办法实现吗?

最佳答案

您需要使用 ion-header-bar 指令在某些内容上方添加固定的标题栏:http://ionicframework.com/docs/api/directive/ionHeaderBar/

继续摇摆!

关于javascript - Ionic 1 : make ion-nav-bar fixed, 不在 View 之间更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42936191/

相关文章:

php - 是否可以仅在移动设备上提供顶级导航服务?

html - 两边剪掉约20px - 手机网站

ios - 在iOS上以连拍方式保存图像

android - 使用 ionic 和 cordova 生成面向 API 级别 30 (Android 11) 的 Android bundle

javascript - PerformanceNavigationTiming API 的特征检测

javascript - localForage 在 Chrome 中找到数据,在 Firefox 中找不到

javascript - Ajax响应改变位置

javascript - jquery if else比较查询问题

javascript - Ionic 3 Google map 不显示在桌面浏览器上

ionic-framework - 更改消息或删除确认警报以在 IOS 中使用 facebook 登录(我使用的是 IONIC 5)