編程學習網 > 編程教程 > ionic 教程
2015
10-27

ionic 頭部和底部

清華大佬耗費三個月吐血整理的幾百G的資源,免費分享!....>>>

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

這個是設置 header-bar 是否跟隨著內容的滾動而滾動,就是是否固定在頂部。它的值是布爾值(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'。

掃碼二維碼 獲取免費視頻學習資料

編程學習