ionic 頭部和底部

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'。