Ionic 1:使 ion-nav-bar 固定,不在视图之间更新
Ionic 1: make ion-nav-bar fixed, not update between views
我正在开发一个非常简单的 Ionic 1 应用程序,我希望 ion-nav-bar
在其中固定,始终保持不变,显示徽标作为每个应用程序的标题查看。
关于 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
导航栏将在我们导航时更新。这使我的图像褪色,感觉每次在视图之间切换时它都在加载。
但我不希望这种情况发生。我希望我的图像始终保持静止,而不是每次更改视图时都更新。有办法实现吗?
您需要使用 ion-header-bar
指令在某些内容上方添加一个固定的 header 栏:http://ionicframework.com/docs/api/directive/ionHeaderBar/
继续摇摆!
我正在开发一个非常简单的 Ionic 1 应用程序,我希望 ion-nav-bar
在其中固定,始终保持不变,显示徽标作为每个应用程序的标题查看。
关于 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
导航栏将在我们导航时更新。这使我的图像褪色,感觉每次在视图之间切换时它都在加载。
但我不希望这种情况发生。我希望我的图像始终保持静止,而不是每次更改视图时都更新。有办法实现吗?
您需要使用 ion-header-bar
指令在某些内容上方添加一个固定的 header 栏:http://ionicframework.com/docs/api/directive/ionHeaderBar/
继续摇摆!