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

これはタイトルを整列させるためのものです。設定されていない場合、スマートフォンのデフォルトレイアウトに従います(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

これはタイトルを整列させるためのものです。設定されていない場合、スマートフォンのデフォルトレイアウトに従います(iOSのデフォルトは中央、Androidのデフォルトは左)。値は 'left'、'center'、'right' を指定できます。

その他の拡張