ionic JavaScript头部和底部

ion-header-bar

这个是固定在屏幕顶部的一个头部标题栏。如果给它加上bar-subheader 这个样式,它就是副标题。

用法

<ion-header-bar align-title="left" class="bar-positive">
  <div class="buttons">
    <button class="button" ng-click="doSomething()">Left Button</button>
  </div>
  <h1 class="title">Title!</h1>
  <div class="buttons">
    <button class="button">Right Button</button>
  </div>
</ion-header-bar>
<ion-content>
  Some content!
</ion-content>

API

属性类型描述
align-title

(optional)
string这个是对齐 title 的。如果没有设置,它将会按照手机的默认排版(Ios的默认是居中,Android默认是居左)。它的值可以是 left,center,right。
no-tap-scroll

(optional)
boolean默认情况下,头部标题栏在点击屏幕时内容会滚动到头部,可以将 no-tap-scroll 设置为 true 来禁止该动作。。它的值是布尔值(true/false)。

ion-footer-bar

知道了 ion-header-bar ,理解ion-footer-bar就轻松多啦!只是 ion-footer-bar 是在屏幕的底部。

用法

<ion-content>
  Some content!
</ion-content>
<ion-footer-bar align-title="left" class="bar-assertive">
  <div class="buttons">
    <button class="button">Left Button</button>
  </div>
  <h1 class="title">Title!</h1>
  <div class="buttons" ng-click="doSomething()">
    <button class="button">Right Button</button>
  </div>
</ion-footer-bar>

API

与 ion-header-bar 不同的是,ion-footer-bar 只有 align-title 这个 API。

属性类型描述
align-title

(optional)
string这个是对齐 title 的。如果没有设置,它将会按照手机的默认排版(Ios的默认是居中,Android默认是居左)。它的值可以是 left,center,right。

作者:唐伯虎点蚊香,如若转载,请注明出处:https://www.web176.com/ionic/9929.html

(0)
打赏 支付宝 支付宝 微信 微信
唐伯虎点蚊香的头像唐伯虎点蚊香
上一篇 2023年2月17日
下一篇 2023年2月17日

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注