我正在开发一个非常简单的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/