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